首页 > 电脑

如何把这个c语言改为c++

更新时间2018-06-23 11:06:01

 

 printf_back();//一个任务结束时的选择浏览还是返回

}void Reback()//DVD返还模块

{int i,n;

 printf("Input the number of member");

 cout("%d",&n);

 printf("Input the number of DVD");

 cout("%d",&i);

 if(Mem[n].dvd1==Dvd[i].name){strcpy(Mem[n].dvd1,'0'); Dvd[i].yes=0;}//strcpy复制字符串覆盖原内容

 if(Mem[n].dvd2==Dvd[i].name){strcpy(Mem[n].dvd2,'0'); Dvd[i].yes=0;}

 if(Mem[n].dvd3==Dvd[i].name){strcpy(Mem[n].dvd3,'0'); Dvd[i].yes=0;}

 printf_back();//一个任务结束时的选择浏览还是返回

void Rent()//DVD租借模块

{int i,j;

 printf("Input the number of member");

 cout("%d",&i);

 printf("Input the number of DVD what you  want to rent!");

 cout("%d",&j);

 if(Mem[i].dvd1!=0||Mem[i].dvd2!=0||Mem[i].dvd3!=0)

 printf("can not rent any more!");

 else if(strcpy(Mem[i].dvd1,'0')){strcpy(Mem[i].dvd1,Dvd[j].name);Dvd[j].yes=1;strcpy(Dvd[j].person,Mem[i].name);}

 else if(strcpy(Mem[i].dvd2,'0')){strcpy(Mem[i].dvd2,Dvd[j].name);Dvd[j].yes=1;strcpy(Dvd[j].person,Mem[i].name);}

 else if(strcpy(Mem[i].dvd3,'0')){strcpy(Mem[i].dvd3,Dvd[j].name);Dvd[j].yes=1;strcpy(Dvd[j].person,Mem[i].name);}

 printf_back();//一个任务结束时的选择浏览还是返回


你的程序不完整

另外

C程序完全可以不加修改地运行在C++下面

因为C是C++的一个子集

所以你的程序不用修改,可以直接用C++编译的

相关标签:c语言

上一篇:MySQL数据库删除部分合并部分

下一篇:GIF优化设置中的色彩8表示颜色数量是8种为什么不对