Posted on 2004-04-19
I have program which basically acts like a bank. It holds a user's account information, and transaction log. It also allows users to withdrawal money, deposit, etc. I need to keep track of all transactions. Currently I use a file "1234.txt" which is the user's account number plus .txt, to hold the user's account information. Then below it, is where the transaction logs will be held. Here is what the file looks like...
The first section is..
The other sections are...
I created an array to hold the input...
This will hold a max of 20 records (five fields in each record because there is a * after each log). I am tryign to load the information from the file into the array with this code...
int i = 0;
ifstream infile; //Creates infile
//Tries to open the file. If it does not exist, it does not create one.
infile >> temp; //used for * after account information
} while (temp != '*');
infile >> transRecords[i];
cout << "H";
} while (infile.eof == 0);
transRecordsSize = i;
cout << i;
The code doesn't execute. The program just bombs out. Any ideas on what I am doing wrong?