home > resources > c++ coding standard > online version

Class Member Names

  • Member names should be prepended with the character 'm'.
  • Member the 'm' use the same rules as for class names.
  • 'm' always precedes other name modifiers like 'p' for pointer.


  • Prepending 'm' prevents any conflict with method names. Often your methods and attribute names will be similar, especially for accessors.

Example 2-4. Class Member Names Example

class NameOneTwo
    int     varAbc();
    int     errorNumber();
    int     mVarAbc;
    int     mErrorNumber;
    String  *mpName;