该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include
#include
int main(void)
{
typedef struct lens
{
float foclen;
float fstop;
char brand[30];
}LENS; //代替 struct lens
LENS bigeye[10] = { { 600,7,"adc" },{700,2,"ang" } };//定义的同时顺序初始化
bigeye[4].foclen = 500;//先定义后逐个初始化
bigeye[4].fstop = 2;
strcpy_s(bigeye[4].brand, 20,"bdddd");
---------------------------------------------------------------------------------------------------------
//bigeye[10] = { [4] = { 600,7,"adcd" } };如何使用这样形式进行初始化
--------------------------------------------------------------------------------------------------
bigeye[6] =(LENS) { 200,4,"hi" };
printf("%s %s %s %s\n", bigeye[0].brand, bigeye[1].brand, bigeye[4].brand, bigeye[6].brand);
return 0;
}
只找到了三种初始化方法,有没有第四种方法