通过本文主要向大家介绍了typedef struct,typedef struct用法,typedef struct node,c语言typedef struct,c typedef struct等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
using namespace std;
void main()
{
int x;
//MSG1作为结构A的别名
typedef struct A{
int age;
char s;
}MSG1,*p1;
MSG1 msg1 ;
msg1.age=10;
p1 point =&msg1;
//msg2作为结构B的变量
struct B{
int age;
char s;
}msg2,*p2 = new B;
msg2.age = 3;
p2->age=4;
//
cout<<(*point).age<<endl<<msg2.age;
//
cin>>x;
}
</div>