C++_练习—this指针

this指针


 1 #include <iostream>
 2 
 3 using namespace std;
 4 
 5 class info {
 6 public:
 7     info(int age) {
 8         this->age = age;
 9         cout << age << endl;
10     }
11     
12 private:
13     int age;
14 };
15 
16 int main(void)
17 {
18     info a(8);
19 
20     system("pause");
21 
22     return 0;
23 }

笔记


Stay hungry, stay foolish 待续。。。
原文地址:https://www.cnblogs.com/panda-w/p/11375484.html