I'm trying to read in a delimited file to my program and insert the contents into a binary tree. Here's what I've got:
Code:char *ffirst; char *flast; char *fcity; char *fstate; char *fzip; fstream inf; inf.open(data, ios::in); while(!inf.eof()) { inf.getline(ffirst, 15, '|'); inf.getline(flast, 20, '|'); /// ERROR ON EXECUTE - CRASHES HERE inf.getline(fcity, 25, '|'); inf.getline(fstate, 2, '|'); inf.getline(fzip, 10, '\n'); system("PAUSE"); insert(ffirst, flast, fcity, fstate, fzip); // Insert data into b-tree }
The program will always crash on me after it reads the first delimited element in the file. I can't find the problem with the code- maybe there's some logic about file I/O that I'm missing here - please help.