Difference between revisions of "Variable"

From ElectroDragon
Jump to navigation Jump to search
 
Line 2: Line 2:
 
* Typically, the underscore is used in front of member variables in a class, to distinguish them (for the reader) from local variables. The presence or absence of the _ (or __) makes no difference to the compiler.
 
* Typically, the underscore is used in front of member variables in a class, to distinguish them (for the reader) from local variables. The presence or absence of the _ (or __) makes no difference to the compiler.
 
* In C++, an underscore usually indicates a private member variable.
 
* In C++, an underscore usually indicates a private member variable.
 +
* Names beginning with an underscore or a double underscore are RESERVED for the C++ implementers. Names with an underscore are reserved for the library to work.
 
== REF ==
 
== REF ==
 
* https://forum.arduino.cc/index.php?topic=48820.0
 
* https://forum.arduino.cc/index.php?topic=48820.0
 
* https://stackoverflow.com/questions/3136594/naming-convention-underscore-in-c-and-c-sharp-variables
 
* https://stackoverflow.com/questions/3136594/naming-convention-underscore-in-c-and-c-sharp-variables
 
[[category: C]]
 
[[category: C]]

Latest revision as of 12:48, 16 February 2020

Underscore

  • Typically, the underscore is used in front of member variables in a class, to distinguish them (for the reader) from local variables. The presence or absence of the _ (or __) makes no difference to the compiler.
  • In C++, an underscore usually indicates a private member variable.
  • Names beginning with an underscore or a double underscore are RESERVED for the C++ implementers. Names with an underscore are reserved for the library to work.

REF