I figured it out --- I did not allocate space for "buffer." Alan
----- Original Message -----
From: Alan Thomas
To: dev...@li...
Sent: Sunday, January 14, 2001 1:00 AM
Subject: illegal operation in while loop
All of a sudden, I started getting an "illegal operation" in a while loop.
I cut everything out of the loop, but I still get the error. The pertinent
code is shown below. Any ideas? I have used the same input file from the
start.
If I change "input_file.getline(buffer, 200, '\t')" to
"input_file.get(c)" then the program does not encounter an error.
Thanks, Alan
char *buffer = "";
char c;
ifstream input_file ("test_tab_win.txt");
while (input_file.getline(buffer, 200, '\t'))
{
// nothing here
}
|