C++ cin.getline(,)的问题
来源:百度知道 编辑:UC知道 时间:2024/06/13 22:46:59
void setfamilymember(familymember & p)
{
cout<<"Please input the name of the family member"<<endl; //输入名字
cin.getline(p.membername,40);
cout<<"Please input the homeplace of the family member"<<endl; //输入出生地
cin.getline(p.homeplace,40);
cout<<"Please input the membersex of the family member"<<endl; //输入性别
cin.getline(p.membersex,6);
cout<<"Please input the stature of the family member"<<endl; //输入身高
cin.getline(p.membersex,3);
cout<<"Please input the edudegree of the family member"<<endl; //输入教育程度
cin.getline(p.edudegree,20);
cout<<"Please input the occupation of the family member"<<endl; //输入职业
cin.getline(p.occupation,20);
cout<<"Please input the zhicheng of the family member"<<endl; //输入职称
cin.getline(p.zhicheng,20);
cout<<"Please input the b
{
cout<<"Please input the name of the family member"<<endl; //输入名字
cin.getline(p.membername,40);
cout<<"Please input the homeplace of the family member"<<endl; //输入出生地
cin.getline(p.homeplace,40);
cout<<"Please input the membersex of the family member"<<endl; //输入性别
cin.getline(p.membersex,6);
cout<<"Please input the stature of the family member"<<endl; //输入身高
cin.getline(p.membersex,3);
cout<<"Please input the edudegree of the family member"<<endl; //输入教育程度
cin.getline(p.edudegree,20);
cout<<"Please input the occupation of the family member"<<endl; //输入职业
cin.getline(p.occupation,20);
cout<<"Please input the zhicheng of the family member"<<endl; //输入职称
cin.getline(p.zhicheng,20);
cout<<"Please input the b
1、将
cin.getline(p.stature,3);
修改为
cin.getline(p.stature,4);
2、将结构familymember的成员stature的维数定义大于等于4。
cout<<"Please input the membersex of the family member"<<endl; //输入性别
cin.getline(p.membersex,6);
cout<<"Please input the stature of the family member"<<endl; //输入身高
cin.getline(p.membersex,3);
两个都是sex,应该这里有问题吧!
能不能把你的familymember的定义给出来?
cin.get 和cin.getline的问题
cin.get和cin.getline的区别?
c++中 输入 cin.get和cin.getline的区别是什么 谢谢
c++ 关于 cin.get() 和 cin.getline()到底有哪些区别啊,苦恼中
cin中的c是什么意思?
关于cin.getline(a,sizeof(a))和istrstream ins(str)的问题
请教c++里string与getline(cin,string)的有关内容.
为什么无法循环,问题是出现在cin.getline(a,sizeof(a))吗?请问有什么方法让他正常循环?
关于C语言的问题,cin cout
c++.net中如果我要用COUT,CIN怎么办