Let’s say we have four files: a.h, a.cpp, b1.h, and b2.h. And, we need to include b1.h and b2.h in either a.h or a.cpp. Where should I include b1 and b2? Let’s say only a.cpp needs b1 and b2.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If it’s not needed for the header file then include it in the cpp.
This reduces compilation time and helps to understand the dependencies between the modules.