چرا این کد روس توابع cin.get ارورداره؟؟
#include<iostream>
#include<string.h>
#include<string>
using namespace std;
class name{
private:
string fname,lname,nname;
public:
name()
{
cout<<"please enter your first name";
cout<<endl;
cinget(fname);
cout<<"please enter your last name";
cout<<endl;
cin.get(lname);
cout<<"please enter your nick name";
cout<<endl;
cin.get(nname);
}
void show()
{
cout<<"last name:"<<lname<<endl;
cout<<"first name:"<<fname<<endl;
cout<<"nick name:"<<nname<<endl;
}
};
class address{
private:
string country ,city,street;
public:
address()
{
cout<<"please enter your country ";
cout<<endl;
cin.get(country);
cout<<"please enter your city";
cout<<endl;
cin.get(city);
cout<<"please enter your street ";
cout<<endl;
cin.get(street);
}
void show()
{
cout<<"country:"<<country<<endl;
cout<<"city:"<<city<<endl;
cout<<"street"<<city<<endl;
}
};
class person:public name,public address
{
private:
int age;
string uni;
public:
person()
{
cout<<"please enter your age";
cout<<endl;
cin>>age;
cout<<"please enter deggree of education;"
cout<<endl;
cin.get(uni);
}
void show()
{
name :: show();
address :: show();
cout<<"age:"<<age<<endl;
cout<<"deggree of education"<<uni<<endl;
}
};
int main(int argc, char *argv[])
{
person ob;
ob.show;
}