Lets say I have a class "ClassA". Is it possible to assign a pointer of another instance of the class to a non-pointer variable? for example
ClassA pineapple();
ClassA* replacementPineapple = new ClassA();
pineapple.refersto = replacementPineapple; <- something like that
The reason I'm asking is because I have a class where I need to move a lot of the class variables to be physically located in a memory mapped file. I could of course just have them as pointers and dereference them every time i need to use them but thats a lot of dereferencing and with all the brackets and other stuff just makes the code really hard to read. If there is any way around that I'll take it.