0xA*_*xAX 13 c structure initialization
如果结构中的一个字段本身是一个结构,我如何初始化结构?
Car*_*rum 14
你需要使用更多大括号(实际上,它们是可选的,但是这些天GCC会发出警告).这是一个例子:
struct s1 { int a; int b; }; struct s2 { int c; struct s1 s; }; struct s2 my_s2 = { 5, { 6, 3 } };
归档时间:
16 年 前
查看次数:
953 次
最近记录:
7 年,7 月 前