Jump to content

RidgeRun Developer Manual/Coding Styles/C++: Difference between revisions

Line 203: Line 203:
/*Regular function*/
/*Regular function*/
FunctionName();
FunctionName();
</syntaxhighlight>
=== Enumerators ===
Enumerators (for both scoped and unscoped enums) should be named like constants, not like macros. That is, use kEnumName not ENUM_NAME.
<syntaxhighlight lang="c">
enmu class MyEnum {
kFieldOne,
kFieldTwo,
};
</syntaxhighlight>
=== Macros ===
Macros are all uppercase and words separated by undersclore.
<syntaxhighlight lang="c">
#define MY_MACRO  5
</syntaxhighlight>
</syntaxhighlight>


Cookies help us deliver our services. By using our services, you agree to our use of cookies.