Hey Everone ,
I Wrote a Program To Enter The info and the given info would be saved to a text file .
Here is The Program Itself :
/* Created By Hayzam Sherif
Date : 11/7/11'
*/
#include <fstream>
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
char name[100];
int age;
char choice[100];
cout<<"Name :";
cin>>name;
cout<<"Age :";
cin>>age;
cout<<name<<"\t"<<age<<" : Should I Save This ?"<<endl;
if(choice == 'y');
{
cout<<"OK"<<endl;
ofstream info;
info.open ("info.txt");
info<<name<<age<<endl;
info.close();
}
else(choice == 'n');
{
break;
}
else if(choice != 'y' || 'n');
{
cout<<"That's Not an option"<<endl;
break;
}
system("Pause");
return 0;
}
I Cannot Understand The Errors xD
Sorry For My Bad English.