c++ - Reading in extended ASCII with cin.get() -


i trying read in single extended ascii characters cin.get(). want use cin.get() can read in spaces, etc in input. figured out need use unsigned chars store characters unsigned chars , cin.get() not seem work together. there way this?

basically, i've been trying this:

unsigned char c; while (cin.get(c)) {    //do stuff c    .... } 

is there way this?

try

 unsigned char c;     while ( (c = cin.get()) != eof )          {            //do stuff           } 

you can try 1 more thing read 255 ascii characters :

int ch; unsigned char c;  while ( (ch = cin.get()) != eof )        {         c = (unsigned char)(ch);          // stuff        } 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -