#include in .h or .c / .cpp? – Stack Overflow

The only time you should include a header within another .h file is if you need to access a type definition in that header; for example: #ifndef MY_HEADER_H #define MY_HEADER_H #include void doStuffWith(FILE *f); // need the definition of FILE from stdio.h #endif If header A depends on header B such as the example above, then header A should include header B directly. Do NOT try to …

Read More