C
Charles Kerekes
Hello everyone,
I am still learning C++, so I'm not sure what I'm trying to do is
possible. Her is a simplified example:
char Test = 'L';
cout << "Test Char as decimal: " << dec << Test << endl;
In the above cout statement, I was hoping it would show 76, the
decimal value of the L character. Instead, it displays an L. Is there
a way to use cout to show the value?
I know I can accomplish this with printf, but wanted to see if cout
could also do it. Thanks in advance.
Charlie
I am still learning C++, so I'm not sure what I'm trying to do is
possible. Her is a simplified example:
char Test = 'L';
cout << "Test Char as decimal: " << dec << Test << endl;
In the above cout statement, I was hoping it would show 76, the
decimal value of the L character. Instead, it displays an L. Is there
a way to use cout to show the value?
I know I can accomplish this with printf, but wanted to see if cout
could also do it. Thanks in advance.
Charlie