Last active
December 18, 2015 12:18
-
-
Save alepez/5781841 to your computer and use it in GitHub Desktop.
C++ Style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********** This begin a section **********/ | |
/** This is short comment */ | |
/** | |
* This is a long long | |
* long, but very long comment | |
*/ | |
/** | |
* Comment with // to disable code | |
*/ | |
// disabledCode(); | |
/********** Variables **********/ | |
/** local variables */ | |
int localVariable; | |
/** | |
* object variables (members) | |
* must be inside class definition | |
*/ | |
int objectVariable_; | |
/** | |
* class variables | |
* must be inside class definition | |
*/ | |
static int classVariable_c; | |
/** | |
* Global variables | |
* Accessible outside current source file (external linkage) | |
* Use only in extreme cases! | |
*/ | |
int globalVariable_g; | |
/** | |
* Global variables, only current source file. | |
* Use unnamed-namespace, instead of static to avoid external linkage. | |
* Must be inside unnamed-namespace. | |
* Use only in extreme cases! | |
*/ | |
namespace { | |
int pretendClientReady_u; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment