I need to read this delimited file into a program using a loop. Each iteration of the loop. the data will be inserted into a tree data structure, but the way I have the loop written, it runs infinately. Please help.
File contents:
Code:
firstName|lastName|City|State|Zip\n
Code:
while(!inf.eof()) {
inf.getline(ffirst, 15, '|');
inf.getline(flast, 20, '|');
inf.getline(fcity, 25, '|');
inf.getline(fstate, 2, '|');
inf.getline(fzip, 10, '\n');
insert(ffirst, flast, fcity, fstate, fzip); // Insert data into binary tree
}