STRING To HEX Converter

Pavilion1984:

No, strtoul() doesn't put anything into any sort of string. It parses an unsigned long integer from a string.

I know it doen't. I was just saying thats how i use it and that it's easy to use.

It might be better to clarify your terminology. You had said:

I use strtoul(). It puts my ASCII sting into a unsigned long HEX string that i can use for anything and is only one line of code.

but you probably meant to say:

I use strtoul(). It puts my ASCII sting into a unsigned long HEX value that i can use for anything and is only one line of code.

or better:

I use strtoul(). It puts my ASCII sting into a unsigned long HEX variable that i can use for anything and is only one line of code.

The variable (at it's lowest level) only contains binary. It can be represented in many bases when output to the serial port (or other Stream device) with built in support for hex, octal, and decimal. You can create your own function to represent it in any base you like. (You could even write a function to represent it in roman numerals if you want.) But at the lowest level all variables are just plain binary.

(I actually read it the way you intended first until you were slapped down...)