Hi, I'm having trouble with comparing a character received from a file. I know, newbie problem. Anyway, I have this code:
Code:
while(tf) {
if (a_file.get() == '"') {
count++; cout <<"got one\n"; }
if (count == 3)
tf = 0;
}
cout <<"now at first position\n";
I'm not getting that last output though. I'm fairly sure that i'm comparing a_file.get() wrong.
What i'm trying to do is count 3 "s and then break. But it's not counting them, so obviously i'm comparing wrong. Any help? Thanks. Oh i'm also having trouble comparing newlines aswell.
I've tried == " \" " but that doesn't work.