//1、
struct book {int a;int b;char c;};//结构声明
struct book library;//结构变量定义
//上述等价于
struct book {int a;int b;char c;} library;
//2、
struct {int a;int b;char c;} library;//不带标记
//3、
typedef struct complex {float real;float imag;} COMPLEX;//可以用COMPLEX来替代 struct complex
typedef struct {float real;float imag;} COMPLEX;//省去了结构标志complex,此时COMPLEX代替 struct {float real;float imag;}
/*实际定义结构体时,可以这样写:
struct complex library;
complex library;
COMPLEX library;
*/
转载请注明原文地址: https://ju.6miu.com/read-1123895.html