Nothing at all.
Most header files have what's called include guards to deal with this very situation.
Even if you don't directly include stdio.h twice, some other include file you have might itself include stdio.h. You would still get double include.
Header files handle this with the macro preporcessor:
//stdio.h
#Ifndef STDIO_INCLUDED
#define STDIO_INCLUDED
// regular header file stuff goes here
#endif
The first time stdio.h is included, STDIO_INCLUDED will not be defined. The preprocessor then defines STDIO_INCLUDED and uses all the header declarations. The second time it is included STDIO_INCLUDED is already defined. All the text between the #ifdef and the #endif is ignored.
Saturday, December 29, 2007
Subscribe to:
Comments (Atom)