+ 1

this pointer in C++

Confusing...!!!

15th Dec 2016, 4:42 PM
Ankish Gupta
Ankish Gupta - avatar
2 Respuestas
+ 1
Not really, once you get it! Try the following code and see what it outputs: class A{ public : A* getThis(){return this ;} }; int main() { A* a = new A; cout << a << endl ; A* a2 = a->getThis(); cout << a2 << endl; return 0; }
15th Dec 2016, 6:21 PM
Ettienne Gilbert
Ettienne Gilbert - avatar
0
Thanks @EttienneGilbert
16th Dec 2016, 3:18 AM
Ankish Gupta
Ankish Gupta - avatar