Which of these is better?
In a class, if I have to call another method which one should I do:
1 2 3 4 5 6 7 8 9 10 11 12
|
class myclass {
void a();
void b();
};
void myclass::a(){
//SOME CODE
b();
}
void myclass::b(){
//SOME CODE
}
|
OR
1 2 3 4 5 6 7 8 9 10 11 12
|
class myclass {
void a();
void b();
};
void myclass::a(){
//SOME CODE
this->b();
}
void myclass::b(){
//SOME CODE
}
|
?
The first is common practice. The second isn't normally used as this-> is implied on all member function/data access.
I usually do myclass::b()
Topic archived. No new replies allowed.