Is there any material about how to use #include correctly? I didn’t find any C/C++ text book that explains this usage in detail. In formal project, I always get confused in dealing with it.
Is there any material about how to use #include correctly? I didn’t find any
Share
Basically you need to understand where include headers are NOT required, eg. forward declaration. Also try to make sure that include files compiles one by one, and only put #includes in h files when it’s a must (eg. templates).