学习心得 struct & typedef struct 的区别

 1 struct   Student 
2 {
3 int a;
4 } stu;//stu变量
5 typedef struct Student2
6 {
7 int a;
8 }stu2;//stu2类型
9
10 #include "iostream "
11 using namespace std;
12 struct fan
13 {
14 int a;
15 }ff;
16 typedef struct qing
17 {
18 int a;
19 }qq;
20 void main()
21 {
22 ff.a=1;
23 cout < <ff.a < <endl;
24 qq q1;
25 q1.a=2;
26 cout < <q1.a < <endl;
27
28 }
posted @ 2012-02-21 20:31  uniquews  阅读(131)  评论(0编辑  收藏  举报