hey all,
I'm writing a C++ console app that converts all the letters of a string to an ALT+NUM equivalent. e.g. e might convert to é (or ALT+1154)
My problem is only with those ALT+NUM combos that have to start with a 0
For example with letter 'd' the only equivalent is Ð (ALT+0208).


That clearly won't work so does anyone know another way??

Thanks very much,

Edited by CoopOwnz: n/a

7 Years
Discussion Span
Last Post by Banfa

May I ask how you process the e example since cout<<(char)1154; is equally likely not to work?


As I understand ur problem, u like to convert ascii code to character
To do so, define a integer variable and initialize it to 1st character asicc code and then assign it to character variable and then print it.

and u like to print all the character for that use loop increment the integer variable and assign to character variable and print it
for further help explain ur problem

I hope it will help you
Best Of Luck.

Edited by prvnkmr194: n/a


BTW you do know that the leading 0 on 0208 effectively tells the compiler that the number is in octal (base 8) in the same way 0x indicates a hexadecimal number?

Have you tried

cout << setw(4) << setfill('0') << 208;

Edited by Banfa: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.