That should printCode:class c { private: int i; public: c() : i(5) {} void print() { int i = 3; cout << i << endl; cout << this->i << endl; } }; int main() { c var; var.print(); return 0; }
Code:5 3
That should printCode:class c { private: int i; public: c() : i(5) {} void print() { int i = 3; cout << i << endl; cout << this->i << endl; } }; int main() { c var; var.print(); return 0; }
Code:5 3
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.