Hello Everyone ,
I Have Made a Simple C++ Code And I Get Some Errors I Have Been Trying To Solve this For Like 2-3 Days :(
I am a Beginner in C++
include <fstream>
include <iostream>
include <cstdlib>
using namespace std;
int main()
{
for
char name[100];
int age;
char choice[100];
char cc[100];
cout<<"Name :";
cin>>name;
cout<<"Age :";
cin>>age;
cout<<name<<"\t"<<age<<" : Should I Save This ? \n (Y/N)"<<endl;
cin>>choice[0];
cout<<"Should I Repeat The Program ?"<<endl;
cin>>cc;
if(cc[0] == 'n')
{
return 0;
}
if(choice[0] == 'y')
{
cout<<"OK"<<endl;
ofstream info;
info.open ("info.txt");
info<<name<<age<<endl;
info.close();
}
else if(choice[0] == 'n')
{
exit(0);
}
else if(choice[0] != 'y' || 'n')
{
cout<<"That's Not an option"<<endl;
exit(0);
}
system("Pause");
return 0;
}