can any1 tell em wut's the wrong with the variables in this code, it has 13 errors,
and also i need to know how to get from b_file more than 1 line,
i'll be pleased if noone takes the code 4 himself.
Code:#include<fstream.h> #include<iostream.h> #include<conio.h> #include<string.h> struct database { int choice; char crt[90]; char fstname[90]; char lstname[90]; char bd[90]; char mon[90]; char str[90]; char opn[90]; int x; char data[1000]; }; int main() { database input; cout<<" Welcome to the new banking program \n"; cout<<"---------------------------------------------------------------------\n"; cout<<"Please choose from the below options:\n"; cout<<"1. Create a new account.\n"; cout<<"2. Open an existing account.\n"; cout<<"3. Edit an existing account.\n"; cout<<"4. Information about the programmer.\n"; cout<<"5. Quit.\n"; cout<<"----\n"; cout<<"Your Choice: "; cin>>input.choice; cin.ignore(); cout<<" -------------------------------------------------------------\n"; if(choice==1) { cout<<"Please type in your account name: * please note u need to type .txt after the file name\n"; cin.getline(input.crt, 90); cout<<"First name:\n"; cin.getline(input.fstname, 90); cout<<"Last Name:\n"; cin.getline(input.lstname, 90); cout<<"BirthDate\n"; cin.getline(input.bd, 90); cout<<"Please type in the amount of money you want to deposit:\n"; cin.getline(input.mon, 90); ofstream a_file(input.crt, ios::noreplace); strcat(input.fstname, " "); strcat(input.fstname, database.lstname); a_file<<"Full name: " <<input.fstname <<"\n"; a_file<<"Birthdate: " <<input.bd <<"\n"; a_file<<"Amout of money: " <<input.mon; a_file.close(); for(int database.x=0;x<101;x++) { cout<<input.x<<endl; } cout<<"The new account has been saved\n"; cout<<"--------- * ____________ * ---------\n"; main(); } if(choice==2) { cout<<"Please Type the name of the account, note .txt must be included:\n"; cin.getline( input.opn, 90); ifstream b_file(input.opn, ios::nocreate); cout<<"\n"; for(int input.x=0;x<101;x++); { cout<<x<<endl; } cout<<input.opn <<"Opened, the data stored is:\n"; b_file.get(input.data, 1000); cout<<input.data; b_file.close(); } }



LinkBack URL
About LinkBacks


