C语言语法

1、结构体定义

struct A{int I;char *S}B;  A为结构体类型名,B为结构体变量;

typdef struct C{int I;char *S}D;  C为结构体类型名,D为结构体类型别名(相当于struct C);

 

C语言中定义结构体变量时必须包含struct,即struct A X;

而C++在允许舍去struct,例如 A X;

 

posted @ 2015-06-19 20:31  右南  阅读(109)  评论(0编辑  收藏  举报