I tried typing the following code in a simple C project, but it keeps saying that MyStruct is undefined – unless I add struct
before every MyStruct
(i.e. struct MyStruct my_struct;
which just feels wrong?).
struct MyStruct {
int my_int;
}
int main() {
MyStruct my_struct;
my_struct->my_int = 1;
return 0;
}