After perusing the web and messing around myself, I can\'t seem to convert a void*\'s target (which is a string) to a std::string. I\'ve tried using sprintf(buffer, \"
sprintf(buffer, \"
If you trying to format the address as text you can use a stringstream:
stringstream
std::stringstream strm; strm << ptr; std::string str = strm.str(); // str will now have something like "0x80004567"
If that's not what you are interested in, please clarify your question.