Is it possible to set default values for some struct member? I tried the following but, it\'d cause syntax error:
typedef struct { int flag = 3; } MyStruct
If you only use this structure for once, i.e. create a global/static variable, you can remove typedef, and initialized this variable instantly:
typedef
struct { int id; char *name; } employee = { .id = 0, .name = "none" };
Then, you can use employee in your code after that.
employee