How to convert a string into hexadecimal??

Hello!!!
I just want to make a program in C++ which can convert an input string into hexadecimal code.
Please help me out with the logic..
Thanks.
sprintf(string,"%02x",character);
Topic archived. No new replies allowed.