I'm trying to tidy up my code by making structures for some parts but when I try to compile this (this code resides in my main function) cygwin gives me an error:
//create structure for holding chunk data
struct Chunk
{
unsigned short ID; //first two bytes
unsigned int size; //last four bytes
};
Chunk firstChunk;
int bytes_read = 1;
bytes_read = sceIoRead(fdin, &firstChunk.ID, sizeof(firstChunk.ID));
here's the error cygwin gives: 'Chunk' undeclared (first use in this function)
I don't think it's recognising the struct for some reason...is it something to do with some compiler options? I've searched google but couldn't find anything.
typdef struct _Chunk
{
unsigned short ID; //first two bytes
unsigned int size; //last four bytes
} Chunk;
Chunk firstChunk;
This will make typing "Chunk" just like typing: struct _Chunk. Actually, I think you can get away with taking out the _Chunk part, but I cant be sure unless I try it.
thanks for the replies, it's working fine now. Actually my main problem was having to notice a variable whos name was typed out with the wrong case (should have had a capital). Stupid mistake I guess.