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
Post a Comment