I realize that this can be a matter of preference, but I have noticed that variables names in a lot of code samples I've seen have a prefix of g_
, s_
, m_
, or just _
. Is this a commonly accepted practice, and what do these prefixes mean? Are there any others that would be good to know?
g_
is a global variables_
is a staticm_
is a member (an instance variable)_
is either a member, or more specifically a private member (both usages turn up)This is common enough that many developers know about it, although it is not (to my knowledge) universally accepted. I don't think you are missing any others.
Update: Integrating comments below for better visibility
_
can also be used to denote a local variable (this one really isn't "standard")k
can be used to denote a constantIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With