How many levels deep can include files be nested?
Even though there is no limit to the number of levels of nested include files you can have, your compiler might
run out of stack space while trying to include an inordinately high number of files. This number varies according to your hardware configuration and possibly your compiler.
run out of stack space while trying to include an inordinately high number of files. This number varies according to your hardware configuration and possibly your compiler.
In practice, although nesting include files is perfectly legal, you should avoid getting nest-crazy and purposely
implementing a large number of include levels. You should create an include level only where it makes sense,
such as creating one include file that has an #include statement for each header required by the module you
are working with.
Cross Reference:
V.3: How can you avoid including a header more than once?
V.4: Can a file other than a .h file be included with #include?
V.12: What is the difference between #include <file> and #include “file”?
V.14: Can include files be nested?
No comments:
Post a Comment