Mail Archives: djgpp/1999/01/30/22:24:04
Jason Filby wrote:
>
> Hi all,
>
> I do I forward declare something so that the following code compiles:
>
> typedef struct _TESTOBJ TESTOBJ; /* Forward declaration??? */
>
> typedef BOOL
> (CALLBACK * FREEOBJPROC)
> (TESTOBJ *pTestObj);
>
> typedef struct _TESTOBJ
> {
> FREEOBJPROC pFreeProc;
> int abc;
> } TESTOBJ;
Something of the form
struct foo;
acts as a forward declaration. So you can say:
struct _TESTOBJ;
typedef struct _TESTOBJ TESTOBJ;
and go from there. Then just don't typedef it again (just declare
struct _TESTOBJ.)
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -