How to convert a string of hex values to a string?

Say I have a string like:

string hex = "48656c6c6f";

Where every two characters correspond to the hex representation of their ASCII, value, eg:

0x48 0x65 0x6c 0x6c 0x6f = "Hello"

So how can I get "hello" from "48656c6c6f" without having to create a lookup ASCII table? atoi() obviously won't work here.

14
задан NullUserException 24 September 2010 в 20:09
поделиться