#include<iostream> #include<fstream> #include<cstring> #include<iomanip> using namespace std; class
帮帮忙,谢谢啦!voidTongxun::settongxun(char*name1,doubleceilphone1,doublehomephone1,doublewo...
帮帮忙,谢谢啦!
void Tongxun::settongxun(char *name1,double ceilphone1, double homephone1,double workphone1,
char *email1,char *team1)
{strcpy(name,name1);strcpy(email,email1);ceilphone=ceilphone1;homephone=homephone1;workphone=workphone1;strcpy(team,team1);
ofstream file("通讯人员.txt",ios_base::app);
file<<getname()<<endl;
file<<getceilphone()<<endl;
file<<gethomephone()<<endl;
file<<getworkphone()<<endl;
file<<getemail()<<endl;
file<<getteam()<<endl;
file.close();
}
void Tongxun::chakan()
{ int i;cout<<"i-0朋友;i_1家人;i=2未知.";cin>>i;
switch(i){
case 0: if(team=="朋友")
ifstream filem("通讯人员.txt",ios_base::in);
while(!filem.eof())
{
filem<<getname();
filem<<getceilphone();
filem<<gethomephone();
filem<<getworkphone();
filem<<getemail();
filem<<getteam();
} 展开
void Tongxun::settongxun(char *name1,double ceilphone1, double homephone1,double workphone1,
char *email1,char *team1)
{strcpy(name,name1);strcpy(email,email1);ceilphone=ceilphone1;homephone=homephone1;workphone=workphone1;strcpy(team,team1);
ofstream file("通讯人员.txt",ios_base::app);
file<<getname()<<endl;
file<<getceilphone()<<endl;
file<<gethomephone()<<endl;
file<<getworkphone()<<endl;
file<<getemail()<<endl;
file<<getteam()<<endl;
file.close();
}
void Tongxun::chakan()
{ int i;cout<<"i-0朋友;i_1家人;i=2未知.";cin>>i;
switch(i){
case 0: if(team=="朋友")
ifstream filem("通讯人员.txt",ios_base::in);
while(!filem.eof())
{
filem<<getname();
filem<<getceilphone();
filem<<gethomephone();
filem<<getworkphone();
filem<<getemail();
filem<<getteam();
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询