Why use prefixes on member variables in C++ classes

前端 未结 29 1397
半阙折子戏
半阙折子戏 2020-11-28 17:39

A lot of C++ code uses syntactical conventions for marking up member variables. Common examples include

  • m_memberName for public members (where public
29条回答
  •  臣服心动
    2020-11-28 17:58

    Code Complete recommends m_varname for member variables.

    While I've never thought the m_ notation useful, I would give McConnell's opinion weight in building a standard.

提交回复
热议问题