Neither of these snippets of code work:
int main() {
struct mystruct {
int a;
char* b;
char* c;
} e,f;
e = {5, "blaat", "boe"};
return 0;
}
Error: syntax error for '{' token
int main() {
struct mystruct {
int a;
char* b;
char* c;
} e,f;
struct mystruct e = {5, "blaat", "boe"};
return 0;
}
Error: previous declaration of 'e' was here
What is the correct way to do this?