I remember on MASM32 compiler the directive ASSUME that let me assume a pointer as a struct. Is any way to do this in C++? For example I want to do this:
char* test = new char [sizeof MyStruct + MAX_REALIGN];
MyStruct* data = test;
data.member = 1;
The reason I need this is because I have a pointer to a struct which I need to recompile with new data, increasing the size of the original struct and realign some of their members. After the recompile is done I will no longer reference to the new struct, I just need the reference before making the recompile.
It sounds a little hard to understand, but the question is quite simple: is there any way to reference a pointer as a struct? (I know its not safe, portable, etc, etc).