1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
void AccTree::loadRecords(ifstream& inFile){
inFile.clear();
inFile.seekg(0, inFile.beg);
Account record;
while(!inFile.eof()){
int tempBSB;
int tempAcc;
char tempName[30];
char tempAddress[50];
int tempPhone;
char tempDate[10];
float tempBalance;
//Collect BSB
char temp[7];
inFile.getline(temp,7 ,'\t' );
tempBSB = atoi(temp);
//Collect Account Number
char temp2[8];
inFile.getline(temp2,8 ,'\t' );
tempAcc = atoi(temp2);
//Collect Name
inFile.getline(tempName,30 ,'\t' );
//Collect Address
inFile.getline(tempAddress,50 ,'\t' );
//Collect Phone
char temp3[10];
inFile.getline(temp3,10 ,'\t' );
tempPhone = atoi(temp3);
//Collect Date
inFile.getline(tempDate,10 ,'\t' );
//Collect Balance
char temp4[7];
inFile.getline(temp4,7 ,'\t' );
tempBalance = atof(temp4);
record.setAccount(tempBSB, tempAcc, tempName, tempAddress, tempPhone, tempDate, tempBalance);
insert(record);
}
}
|