PDA

View Full Version : C file management


sealfin
2002.07.24, 10:15 AM
is there a similar statement to extern for a typedef/struct/et al?

inio
2002.07.24, 10:46 AM
No. Types must be fully defined before they can be used. There is however a special case for a pointer to a struct:

typedef struct Foo *FooPtr;

and with c++

class Bar;

will allow you to use FooPtr's (and in the C++ case Bar& and Bar*) with all the advantages of strong typing without knowing what the innards of a Foo look like.

This is rarely useful on small- and medium sized projects, as it's only real purpose is data hiding. Why do you need this?