c++ convert string to hex

Viewed 98997

Possible Duplicate:
C++ convert hex string to signed integer

I allready searched on google but didn't find any help. So heres my problem: I have strings that allready contains hex code e.g.: string s1 = "5f0066" and i want to convert this string to hex. I need to compare the string with hex code i've read in a binary file.

(Just need the basic idea how to convert the string) 5f Best regards and thanks.

Edit: Got the binary file info in the format of unsigned char. SO its 0x5f... WOuld like to have teh string in the same format

3 Answers
Related