Ascii to binary

Hi there,

I'm trying to write a program on c++ that asks you type a character (a-z) and then prints the value of it in ASCII and binary. So far I can let it print the character I type in ASCII, but after doing some research on the Internet and this forum haven't really found a simple way to convert the given value into binary. Any ideas or examples on how I could do this? Any help would be appreciated.

Thanks!
closed account (EwCjE3v7)
 
cout << bitset<8>(c) << endl;
Topic archived. No new replies allowed.