   How to you organise your cpp and header files?
  So I am working on a new project and trying to come up with ways to organise my cpp and header files. I am using VS 2005, breaking up different functionality of the project into different smaller projects inside the solution.I was originally thinking of1) have the .h file together with the .cpp OR2) have a folder called src, and another called include, and have a parallel structure that looks like this:\src\Data\src\Modules...\include\Data\include\ModulesI am not writing a library (but some of the functionalities may be reused by other projects later)...which approach is better for the long run?Thanks in advance!   
  After a couple of years I decided (at least for now) that the best way to organize my source files is .h and .cpp in the same folder, and the directory structure organized exactly as the namespaces defined in the program/library (A contains B contains C).   ;  I tend to just dump all source files in a single directory, and let IntelliSense deal with it. I used to do the whole nested-directories thing, but I don't find it worth the effort to maintain these days - at least for C++: languages with a proper package mechanism (such as Python) are another story.   ;  I tend to do the same thing as owl: group .cpp and .h files together and mirroring the namespace structure. Intellisense often breaks on templated code, so dumping everything into one directory doesn't work very well for me.   ;  include/src with parallel directory structures for now. This is mostly to cater to my own sense of structure: when #include-ing files, I'd rather see something like #include "resources/cache/resource_cache.h" than simply #include "resource_cache.h". This way I can get a sense of which systems depend on which other systems just by looking at the directories from which they pull their #includes.   ;  I keep a... * include folder for shared headers(without extension) & template implementations * a source folder for non-shared headers(with extension) and source foldersBoth have sub-directories roughly based around project/namespaces (the enum hack comes to mind as an exception)   ;  More answers here. :)   ;  I toss everything in one folder and use filters in Visual Studio to organize them within the IDE.   ;Quote:Original post by owlAfter a couple of years I decided (at least for now) that the best way to organize my source files is .h and .cpp in the same folder, and the directory structure organized exactly as the namespaces defined in the program/library (A contains B contains C).Exactly, its what I use as well...almost by default I done it that way for the first time. If you give a class a category (namespace) it makes very much sense to put it in the same category directory wise.;  I have found over the years that there are very strong advantages to mimicing the C++ namespace heirarchy with a source file namespace heirarchy.  This eliminates filename conflicts the same way it does variable and type names.I have also found the urge to place headers and sources in separate directory heirarchies somewhat weird and unjustifiable.  Sources and headers go together.  When generating a dev package for a library the headers get pulled and packaged separately anyways.Generally, assets are kept in a separate directory heirarchy because they are run-time data not build-time data.Packaging metadata is also stored separately from sources.  This simplifies making targeted source distributions.Finally, a separate heirarchy for test suites are separate from sources.  Testing should be orthogonal to building and packaging.   