convert string to char

hi,

i got a string str which contains md5 values.
e.g str = "0589eb4301a8b5438553488adfa23961"

i need to convert this value to decimal so im doing this:
char string[] = str;
long value = strtol(string, NULL, 16);
cout << "hexadecimal:" << value << endl;

how to i convert variable str to char?:
There's no way you can convert that thing to a single integer (unless you're working with a 128-bit computer). You'll have to split into four strings and put each into their own integer.

Although, what do you mean "convert string to char"?
To get a C string ( char* ) you cave str.c_str() but it wont work for a char[]
Topic archived. No new replies allowed.