c++ - Reading in an ascii extended character -


i'm having problem reading in extended ascii character , converting it's decimal value. tried doing this:

unsigned char temp; while(temp = cin.get != eof) { cout << (int)temp << endl; } 

but prints out number 1;

the problem here:

while(temp = cin.get() != eof).

you assigning temp truth value of cin.get() != eof. until eof encountered, see 1 output.

changing to: while((temp = cin.get()) != eof).

will give more closely expecting.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -