#include<iostream>
#include<string>
using namespace std;
class person
{
public:
string name;
string getname()const;
void set(string sendstring){address=sendstring;}
string getaddress()const{return address;}
private:
string address;
};
string person::getname()const
{
return name;
}
int main()
{
person person1;
person1.set("HighEducationCentre");
person1.name="giant";
cout<<person1.getname()<<endl;
cout<<person1.getaddress()<<endl;
}
public,private
最新推荐文章于 2023-10-08 14:50:11 发布