September 21st, 2012, 07:09 PM
Custom struct not working in C
Using VS2010, I defined a custom struct in the file vectorMath.h:
Then in main.c I have:
typedef struct Vector
And, later on,
However, I get a compile error pointing out the line with Vector position; saying error C2061: syntax error : identifier 'position'. When I move the code for defining the struct inside main.c, above the declaration of position, I still get an error. I looked over tutorials for defining structs, but I don't see any error I'm making. Is there something fundamental I'm missing?
There's two other custom structs, defined the same way, and they work fine. It seems ridiculous, but is there a maximum limit to the number of custom structs I can have?
Last edited by fiodis; September 21st, 2012 at 07:14 PM.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!