2
votes

If a particular header is already included in stdafx.h - do I need to (have to/should to) to explicitly include it in a .cpp file (which already includes the stdafx.h) ?

1

1 Answers

4
votes

When stdafx is created for you it is typically a precompiled header. As a precomiled header it will be necessary to add it to any .cpp that is marked to use precompiled headers (normaly any cpp added to the project except for stdafx.cpp)

You don't need to include headers already included in stdafx.h, including it again may cause extra effort for the compiler.