Is this correct?
unsigned int address = (unsigned int)pointerToClass;
I'm trying to figure out if my pointer is getting corrupted... (I'm fairly certain it is).
unsigned int address = (unsigned int)pointerToClass;
Quote:Original post by Servant of the Lord
I'm trying to figure out if my pointer is getting corrupted...
myClass::myClass(){ this->pointerToClass = GetPointerFromFunction(); if(this->pointerToClass == NULL) std::cout << "Pointer is NULL"; this->address = (unsigned int)this->pointerToClass;}myClass::~myClass(){ std::cout << "Original address: " << this->address; std::cout << "Current address: " << (unsigned int)this->pointerToClass; FreePointer(this->pointerToClass) this->pointerToClass = NULL;}
this->address = &(*this->pointer);
But it wouldn't compile.Quote:Original post by Servant of the Lord
I'm trying to store the address for later viewing.
Quote:Original post by Gage64Quote:Original post by Servant of the Lord
I'm trying to store the address for later viewing.
Sorry if I'm missing something, but why not just store it in another pointer?