i am having a binary value read from file and have to make comparison whether its a 1 or 0 but when i try to compare
char ch;
while(!in.eof()){
in.get(ch);
if(ch=='0') count0++;
}
The above code is not executing even when ch='0'
if(ch=='1') count1++;
that too is not giving me correct answer how these can be compared? it has to do something with the ascii coding or something?
From a comment:
The content of the file is 01101111111111111100000000
just like that. It's a .txt file