I'm trying to define a storage type Uint8. Heres my definition:
#define Uint8 unsigned char
But I get this error when I try and use it:
error C2061: syntax error : identifier 'Uint8'
Could someone tell me what I'm doing wrong here? Thanks.
I'm trying to define a storage type Uint8. Heres my definition:
#define Uint8 unsigned char
But I get this error when I try and use it:
error C2061: syntax error : identifier 'Uint8'
Could someone tell me what I'm doing wrong here? Thanks.
Yeah I think you are right there. It works in main. I was trying to use it in a header file, but it wont work. I have it defined before my header include, so I don't know what would be causing this. I'm using VC++ atm if that makes any difference.
Ok I worked it out now. It was all to do with the sequence of includes and definitions. I need to have my 'typedef's after using 'name space' and before my own includes, but 'name space' needs to come after the iostream include.
You should put the typedef in the header, or in another header #include'd by the header that needs it.
Forcing a certain order of includes is a bad idea.
Oh yeah, that sounds like a good idea. Tbh my prog is pretty simple at the moment, but I'll get into the habit of doing that.