ok, if I do the following, I get the following:
for some reason the compiler thinks that 08 and 09 are octal values. Anything decimal 10+ is fine.
How do I tell the compiler it's a decimal?Code:outp<<(char)09 gives invalid digit "9" in octal constant|
If I do this, it is fine!
Code:int main() { for ( int x = 0; x < 20; x++ ) { cout<< x <<": "<< (char)x <<"\n"; //Note the use of the int version of x to // output a number and the use of (char) to // typecast the x into a character // which outputs the ASCII character that // corresponds to the current number } cin.get(); return 0; }



LinkBack URL
About LinkBacks



