Yes, there are recommendations. Some of them:
- Order . If you are in MyClass.cpp, first put "MyClass.h", then the C-headers, then the STL headers, and then your project headers.
- The internal order . Use the alphabetical order in each of these categories.
- Syntax Use
#inlcude <> for C and STL and #include "" for your own headers.
They should look something like this:
#include "MyClass.h" #include <time.h> #include <iostream> #include <vector> #include "MyFolder/MyAwesomeClass.h" #include "MyOtherFolder/MyOtherClass.h"
For more recommendations on good coding style, you can take a look at the Google C ++ Style Guide . They give a good explanation of why you should do this in this section .
source share