What does `m_` variable prefix mean?

前端 未结 9 741
太阳男子
太阳男子 2020-12-22 18:47

I often see m_ prefix used for variables (m_World,m_Sprites,...) in tutorials, examples and other code mainly related

9条回答
  •  执念已碎
    2020-12-22 19:00

    To complete the current answers and as the question is not language specific, some C-project use the prefix m_ to define global variables that are specific to a file - and g_ for global variables that have a scoped larger than the file they are defined.
    In this case global variables defined with prefix m_ should be defined as static.

    See EDK2 (a UEFI Open-Source implementation) coding convention for an example of project using this convention.

提交回复
热议问题