Answer the question
In order to leave comments, you need to log in
How to use nested includes in headers and code?
I have a "base" header file which expands the structures, constants and prototypes for the header implementation file.
There is also a "complex" header file that uses these basic structures, constants and prototypes in its definitions of constants and prototype structures. The "complex" header is expanded for the header implementation file.
After including "complex" in the project's source code files, you should be able to use all of these definitions and functions.
How to do it? I'm confused about the inclusions.
Answer the question
In order to leave comments, you need to log in
Simple file Ah, complex Bh
Bh includes Ah Some C.cpp includes both Ah and Bh in any order. The trick is to use header guards. It's this thing:
#ifndef blablabla
#define blablabla
// определения
#endif // конец файла
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question