include files question

  • Thread starter Thread starter Sandrik
  • Start date Start date
S

Sandrik

Hi, I have question which might be more style question, as
I've never seen any discussion about this in any C/C++
books.

Is there a rules where to include files in .h or .cpp ?
What I usually do is if I have some xxx module, then all
the includes I do in xxx.h and xxx.cpp has only one
include to xxx.h, so I generally want to know if there is
something wrong in this way.

Thank you all in advance
 
Sandrik said:
Hi, I have question which might be more style question, as
I've never seen any discussion about this in any C/C++
books.

Is there a rules where to include files in .h or .cpp ?
What I usually do is if I have some xxx module, then all
the includes I do in xxx.h and xxx.cpp has only one
include to xxx.h, so I generally want to know if there is
something wrong in this way.

See "Large Scale C++ Software Design" by John Lakos for an in-depth
discussion of header file organization and usage.

-cd
 
Back
Top