Quote:
Originally Posted by Argitoth
There is 'k' and 'm' at the beginning of many variables. What do they represent?
|
The m for member variable, the k for constant (I think). Sometimes you will also see g for global, s for static, and e for enumerator. These prefixes are used to distinguish beteen normal (local) variables, and member/global/static variables or constants/enumerators. Note that you don't have to use these prefixes, but it is considered good practice.
Code:
class MyClass
{
...
int mY;
void Square(int x)
{
int y = x*x;
mY = y;
}
};