valor padrão para o membro struct em C
É possível definir valores padrão para algum membro de struct? Eu tentei o seguinte, mas, ele causaria erro de sintaxe:
typedef struct
{
int flag = 3;
} MyStruct;
Erros:
$ 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’