定义结构时,如果同时定义该结构类型的变量,结构名可以省略不写。
struct{
char name[30];
int quantity;
int cost;
}printer_cable_bin;
定义了变量printer_cable_bin,但还没有建立数据类型,换句话说,printer_cable_bin是这个程序中你需要的唯一变量,这个变量的数据类型是匿名结构。
定义结构时,如果同时定义该结构类型的变量,结构名可以省略不写。
struct{
char name[30];
int quantity;
int cost;
}printer_cable_bin;
定义了变量printer_cable_bin,但还没有建立数据类型,换句话说,printer_cable_bin是这个程序中你需要的唯一变量,这个变量的数据类型是匿名结构。