Commonly Accepted Variable Name Formatting - C/C++ -


i realize can matter of preference, have noticed variables names in lot of code samples i've seen have prefix of g_, s_, m_, or _. commonly accepted practice, , these prefixes mean? there others know?

  • g_ global variable
  • s_ static
  • m_ member (an instance variable)
  • _ either member, or more private member (both usages turn up)

this common enough many developers know it, although not (to knowledge) universally accepted. don't think missing others.

update: integrating comments below better visibility

  • _ can used denote local variable (this 1 isn't "standard")
  • k can used denote constant

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -