I have a pointer like this.
MyClass *p; //MyClass is a complex class
I need to create a new pointer that has a copy of data that is inside the object pointed by p. After copying, I need to change my new object without changing the object pointed by *p.
When I do MyClass *q = p it copies the pointer. What is the correct way to do this?
I want to do something like:
MyClass *q = &p;
and when I now change an attribute of the object pointed by q, I should not affect the object at *p.
Please help me with this.
MyClasscopyable? Can you doMyClass a, b; a = b;?*while typingp