how does the compiler handle this ?

Started by
2 comments, last by Fred304 18 years, 11 months ago
head1.h include head2.h and head2.h include head1.h but this way all is ok ,so how does the compler handle this ?
Advertisement
include guards

#ifndef __SOME_COOL_NAME#define __SOME_COOL_NAME// ...#endif

Everything between the #ifndef and the #endif will only be included once.
And if you don't have the include guards, then the compiler will give an error after a certain depth (around 100 recursions sounds sensible)
Hm, after giving this a second thought, I think the compiler does not handle this it all - the preprocessor does.

This topic is closed to new replies.

Advertisement