c:c_this_pointer
C - C++ This Pointer
#include <iostream> using namespace std; class MyClass { int i; public: void setI(int val) { this->i = val; } int getI() { return this->i; } } ; int main() { MyClass o; o.setI(100); cout << o.getI(); return 0; }
c/c_this_pointer.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1