Code:
char *s, array[] = "Hello World!";
for( s = array; s && *s; s++ )
printf("0x%x ", *s );
Or did you mean you wanted the string new array to be something like:
Code:
char newarray[] = "0x48 0x65 0x6c 0x6c 0x6f 0x20 0x57 0x6f 0x72 0x6c 0x64 0x21";
If so, if you don't want spaces between the hex digits, and you don't want the 0x, just create a string twice the size of the length of the other string, plus one, and stick them in there.
I'll leave that as an exercise for the reader, since it's fairly easy, and we have to leave something for you to do...
Quzah.