I'm trying to get a pointer to a (typedef'd) struct inside itself. I know that the addrinfo struct does it (albeit not typedef'd), but I'm having trouble doing the same.
Quotetypedef struct _ofdpfolder {
ucstr_t* name;
unsigned long numFiles;
unsigned long numFolders;
ofdpfile_t* files;
ofdpfolder_t* folders; // line 21
} ofdpfolder_t;
This is the code I'm trying to use, but gcc is telling me:
Quote from: GNU C Compilerfiles.h:21: error: parse error before "ofdpfolder_t"
Any ideas on how I can get this to work properly?
change that line to:
struct ofdpfolder_t* folders; // line 21
Well, that didn't work, but I think I know what you meant. Although I thought I had the line as
Quotestruct _ofdpfolder* folders; // line 21
before, and it didn't work, that's how it reads now, and it works fine. Thanks.
hmm, yes, that'd be it. I never typedef my structs so I didn't notice :)