tags:

views:

90

answers:

3

Hi, it seems that separate them into src and hdr is a popular solution. however, this is not the case in Netbeans: by default, netbeans will put both hpp and cpp files in the same directory.

questions:

  1. should I separate them or not? why?

  2. if 1 is yes, is there any way to automatically set this in Netbeans?

+4  A: 

If you plan to distribute a library as binaries and headers, it might be easier to have the headers in a separate directory to begin with.

Josef Grahn
+3  A: 

Headers for private module stuff, should be with your code, public headers for the module should be separate.

Simeon Pilgrim
+1  A: 

This is a style preference, which means you should choose a style and stick with it. Different shops have different styles and best behavior is to adapt to their style when working on their projects.

For C++, I prefer to have the headers in the same directory as the source files. Many shops prefer to separate the header and source files into separate directories.

Thomas Matthews