structDemo1
structDemo1
# include <iostream.h>
# include <malloc.h>
enum EType{
One = ,Tow,Three
}; struct S1{
int id ;
char name [];
long version ;
}; int main(void){
EType one = Tow;
cout << "one = " << one << endl ; cout << "hello world !! " << endl ;
cout << endl << "hello world !! << endl "; for (int i () ; i < ;i++){
EType type = (EType) i ;
if(One == type )
cout << " is One " << endl;
if(Tow == type)
cout << " is Tow " << endl;
if(Three == type)
cout << " is Three " << endl;
} cout << "i = " << i <<endl; S1 s1 = {,"s1",}; cout << " s1.id = " << s1.id << " , s1.name = " << s1.name << " , s1.version = " << s1.version << endl; S1 * ps1 = &s1;
cout << "ps1->id = " << ps1->id << endl; ps1 = (struct S1 *)malloc( sizeof(struct S1));
ps1->id = ; (*ps1).version = ;
cout << " ps1->id = "<< ps1->id << " ,(*ps1).version = " <<(*ps1).version << endl; return ;
}
structDemo1的更多相关文章
随机推荐
- 编辑UITableviewCell--Editing
self.navigationItem.rightBarButtonItem = self.editButtonItem; - (void)setEditing:(BOOL)editing anima ...
- 调用iframe 中的js[兼容各种浏览器]
*chrome浏览器需要在服务器环境中测试 <!DOCTYPE html> <html> <head> <meta http-equiv="cont ...
- Android 自定义View修炼-仿QQ5.0 的侧滑菜单效果的实现
有一段时间没有写博客了,最近比较忙,没什么时间写,刚好今天有点时间, 我就分享下,侧滑菜单的实现原理,一般android侧滑的实现原理和步骤如下:(源码下载在下面最后给出哈) 1.使用ViewGrou ...
- Android_Intent_note
Activity间传递参数的方法方法1. 通过putExtra()传递基本数据类型方法2. 通过putExtras()传递Bundle数据类型方法3. 通过Application读写全局变量 方法4. ...
- mysql配置优化
[笔记]MySQL 配置优化 安装MySQL后,配置文件my.cnf在 /MySQL安装目录/share/mysql目录中,该目录中还包含多个配置文件可供参考,有my-large.cnf ,my- ...
- [Form Builder]内置函数execute_trigger、do_key详解
转:http://yedward.net/?id=82 1.execute_trigger:用来运行一个指定的触发器,常用来运行用户自定义的触发器. 语法:procedure execute_trig ...
- xml_02
1.xml 2.对于XML文档的约束 |-DTD <!DOCTYPE 根元素 [ <!ELEMENT 元素名 (xx)> <!ATTLIS ...
- Android应用程序消息处理机制笔记
看老罗的Android源码情景分析学习的时候,边抄边理解再总结.希望能为面试提供点帮助吧. 1.Android应用程序是通过消息来驱动,Android应用程序每一个线程在启动时,都可以首先在内部创建一 ...
- XCOPY: Access denied
用 XCOPY 拷贝文件,出现 “Access denied” 提示信息. 原因: 在如上拷贝的目标路径下,存在 ReadMe.txt, 并且是 只读 文件,这种情况下,需要增加一个 拷贝选项: /R ...
- 九度OJ 1108 堆栈的使用
题目地址:http://ac.jobdu.com/problem.php?pid=1108 题目描述: 堆栈是一种基本的数据结构.堆栈具有两种基本操作方式,push 和 pop.Push一个值会将其压 ...