2011年(100)
分类: C/C++
2011-04-22 10:00:36
class this_pointer_example // class for explaining C++ tutorial { int data1; public: //Function using this pointer for C++ Tutorial int getdata() { return this->data1; } //Function without using this pointer void setdata(int newval) { data1 = newval; } }; |
onezeroone2011-04-24 15:59:07
only one copy of each member function and the data members are allocated memory for all of their instances.