関数パラメータとデータ・メンバーの名前


#include<iostream> #include<string> #include<stdio.h> #include<stdlib.h>

using namespace std; class boy { string name; int age; public: boy(string name,int age) { name=name; age=age; this->name=name;// , , 

        boy::age=age;// , this  

 } void get() { cout<<this->name<<" "<<this->age<<endl; } }; int main() { boy a("guo",22); a.get(); system("pause"); return 0; }