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

jquery - isAjaxRequest always return false -

php - SPIP: From Tag directly to an article -