+ 2
How to save a c++ program
4 Answers
+ 9
In your computer?
1.Open Notepad++
2.Write C++ program
3.Save As. (Extension:.cpp)
+ 4
if you are using codeblocks for example,
Go to File > New,
Type your program,
Click Save , then Save As,
Give it a name then ".cpp" extension e.g.
helloWorld.cpp
then press enter.
+ 2
Save it as Filename.cpp
0
case 4:{
string sname;
cout<<"update by name: ";cin>>sname;
for(i=0;i<n;i++){
if(sname==obj[i].getName()){
obj[i].input();
cout<<"success!"<<endl;
}else{
cout<<"not success!"<<endl;
}
}
}break;
default:
cout<<"not options: "<<op<<endl;
cout<<"please chose option again \n"<<endl;
break;
case 5:{
string sname;
cout<<"delete by name: ";cin>>sname;
for(i=0;i<n;i++){
if(sname==obj[i].getName()){
for(j=i;j<n;j++){
obj[j]=obj[j+1];
}
n--;
cout<<"remove success!"<<endl;
}
}
}break;
default:
cout<<"not options: "<<op<<endl;
cout<<"please chose option again \n"<<endl;
break;
case 6:{
string insert;
cout<<"insert by name: ";cin>>sname;
for(i=0;i<n;i++){
if(insert==obj[i].getName()){
for(j=n;j>i;j--){
obj[j]=obj[j-1];
}
n++;
obj[i].input();
cout<<"insert success!"<<endl;
break;
}
}
}break;
default:
cout<<"not options: "<<op<<endl;
cout<<"please chose option again \n"<<endl;
break;
}getch();
}while(op!=0);
return 0;