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 ;
}
上一篇:CSS魔法堂:Reset CSS


下一篇:努力学习 HTML5 (3)—— 改造传统的 HTML 页面