#include <sstream> //for std::stringstream #include <string> //for std::string const void * address = static_cast<const void*>(this); std::stringstream ss; ss << address; std::string name = ss.str();