T
The Cool Giraffe
Usually, when i declare a method and a variable in the
header file i go as follows.
public:
int number;
void doSome ();
Then, in the CPP-file i will define it as follows.
int number;
void SomeClass::doSome () {this.number = 5;}
How do i explicitly state that "number" belongs to the class
"SomeClass"? I know for a fact that i don't go SomeClass::
in front of it.
I understand that the class name followed by colon-colon is
there to specify in what class the definition is supposed to
be put. Does the lack of the explicit specification on the
variables mean that they are global? How to avoid it?
header file i go as follows.
public:
int number;
void doSome ();
Then, in the CPP-file i will define it as follows.
int number;
void SomeClass::doSome () {this.number = 5;}
How do i explicitly state that "number" belongs to the class
"SomeClass"? I know for a fact that i don't go SomeClass::
in front of it.
I understand that the class name followed by colon-colon is
there to specify in what class the definition is supposed to
be put. Does the lack of the explicit specification on the
variables mean that they are global? How to avoid it?