“Parse error” in struct declaration
https://stackoverflow.com/questions/2543590
Solution
C structs live in a different namespace and have to be explicitly scoped, thus:
struct p {
int a;
int b;
struct p * next;
};
And don't forget the semicolon at the end! :-)
You can pretend you're in C++ thus: typedef struct p { /*...*/ } p;
. But I think that next
will still have be declared as above.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow