Concrete Geist
10-20-2001, 12:08 AM
I need a better understanding of how the C preprocessor is used to prevent multiply header file inclusions. Here is an example of my book, which I can't figure out.
#if defined( prog_h )
/* The file has been included already */
#else
#define prog_h
/* Header file goes here... */
#endif
Now say I write a header file that requires string.h and ctype.h, how would I avoid multiple inclusions in the main program by the programmer? The above example doesn't explain this to me.
[ 20 October 2001: Message edited by: Concrete Geist ]
#if defined( prog_h )
/* The file has been included already */
#else
#define prog_h
/* Header file goes here... */
#endif
Now say I write a header file that requires string.h and ctype.h, how would I avoid multiple inclusions in the main program by the programmer? The above example doesn't explain this to me.
[ 20 October 2001: Message edited by: Concrete Geist ]