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;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 Gage64 Quote:
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?
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more