G
Giff
Hi,
I hope this post is not too OT.
I am porting some code from Windows to Linux and I am having a problem
with a routine that skips comments and empty lines in a txt file.
The following code has worked nicely on Windows, but it does not on
Linux, I understand that is because the two OS uses different way of
ending a line.
char next = static_cast<char>(is.peek());
//if the first character of the line is a comment or the endline
while( next == '\n' || next == comment ) {
//ignore the whole line
is.ignore( 10000, '\n' );
//check the next line
next = static_cast<char>(is.peek());
}
How would you suggest I should modify the above function to work under
Linux (or better under any OS)?
Thanks a lot,
G
I hope this post is not too OT.
I am porting some code from Windows to Linux and I am having a problem
with a routine that skips comments and empty lines in a txt file.
The following code has worked nicely on Windows, but it does not on
Linux, I understand that is because the two OS uses different way of
ending a line.
char next = static_cast<char>(is.peek());
//if the first character of the line is a comment or the endline
while( next == '\n' || next == comment ) {
//ignore the whole line
is.ignore( 10000, '\n' );
//check the next line
next = static_cast<char>(is.peek());
}
How would you suggest I should modify the above function to work under
Linux (or better under any OS)?
Thanks a lot,
G