Argv[] to Hex

I am trying to figure out how to take in argv as a hex value.

An example would be - ./myprogam abcdef123456

I need the value of abcdef123456 to be a hex value of 0xabcdef123456

I have tried google and various attempts (scanf, strtol, atoi) and can't seem to get it working. Any help would be amazing.
Use stringstreams and manipulators
Topic archived. No new replies allowed.