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的更多相关文章
随机推荐
- javaHDU1003Max Sum
import java.util.Scanner; public class Sum {public static void main(String args[]) {Scanner cin=n ...
- Java基础知识强化之IO流笔记52:IO流练习之 把一个文件中的字符串排序后再写入另一个文件案例
1. 把一个文件中的字符串排序后再写入另一个文件 已知s.txt文件中有这样的一个字符串:"hcexfgijkamdnoqrzstuvwybpl" 请编写程序读取数据内容,把数据排 ...
- Hibernate的fetch (转)
fetch ,可以设置fetch = "select" 和 fetch = "join" 用一对多来举例: fetch = "select" ...
- centos 7.x编写开机启动服务
centos 7以上是用Systemd进行系统初始化的,Systemd 是 Linux 系统中最新的初始化系统(init),它主要的设计目标是克服 sysvinit 固有的缺点,提高系统的启动速度.关 ...
- Android Studio快捷键快速入门
调整,Settings->IDE Settings->Editor->Appearance->Show line numbers 显示代码行数Settings->IDE ...
- Android 自定义Gallery浏览图片
之前写的<Android ImageSwitcher和Gallery的使用>一文中提到我在教室一下午为实现那个效果找各种资料.期间在网上找了一个个人觉得比较不错的效果,现在贴图上来: 其实 ...
- 获取API返回值
//$return=getApiResult($url); // if ($return==200){ // //..... // } function getApiResult($url){ if( ...
- OC加强-day06
#program mark - 08 NSMutableDictionary的使用 [掌握] "/08 NSMutableDictionary的使用/1_练习 "练习 1.小明的身 ...
- java Email发送及中文乱码处理。
public class mail { private String pop3Server=""; private String smtpServer=""; ...
- Bzoj 2431 HAOI2009 逆序对数列
Description 对于一个数列{ai},如果有i**<**j且ai>aj,那么我们称ai与aj为一对逆序对数.若对于任意一个由1~n自然数组成的数列,可以很容易求出有多少个逆序对数. ...