Hi,
Ive been stuck on this bug for a while now, Ive tried googling the answers etc but everything I try seems to fail:
Code:
string yytext;
char ch;
instream.get(ch);
yytext += ch; // Puts character from stream on the end of the string
while(isalnum(ch)) // loop while character is alpha-numeric
{
instream.get(ch); // needs to call the next character in the stream
yytext += ch; // add character to end of string
}
instream is streaming a text file into the program; this part of my function needs to stick alphanumeric characters together in to a word.
Whats happening is the instream.get(ch); is just pulling the same character off the instream, and going into an infinite loop
is there a nice simple call I can use to increment the steam position?
Any suggestions would be awesome,
thanks,
Pete