Are you trying to convert the value of the pointer, or where the pointer
is
pointing to?
Either way, reinterpret_cast is what you want.
reinterpret_cast<int>( Foo );
Below is exactly what I'm doing. I want to read a value from the
registry. Let's say the registry value is "453".
unsigned char ikey[256];
ULONG ilen = 256;
HKEY ihKey;
RegQueryValueEx(ihKey, "Value", 0, NULL, ikey, &ilen);
But now ikey is not an int, i want an int of value 453.
int RegistryVal = reinterpret_cast<int>(ikey);
This does not work.
The reason i asked about converting to a constr char * is that I
wanted to use atoi()