I am trying to convert bytes in a string to hex and would like to find a simple way to do this.

I have type casted the individual characters of a string to unsigned ints and printed them to the screen using the following code in hex, but I know if this only converts the decimal value to hex...is this really the hex representation of the bytes representing the character?

Code:
for(i=0;i<=37;i++){
	printf("%x",(unsigned int)input[i]);
	}
Thank you for your time!
windell