是否可以为某个结构成员设置默认值? I tried the following but, it'd cause syntax error:
typedef struct
{
int flag = 3;
} MyStruct;
错误:
$ gcc -o testIt test.c
test.c:7: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘=’ token
test.c: In function ‘main’:
test.c:17: error: ‘struct <anonymous>’ has no member named ‘flag’