I am really stuck here. From what I have read online a deep copy constructor copies what is in the pointer (prob not exactly what it is). I have looked at code online but seems overly complex for my application.Any way I know this forum is not a code writing service but if someone can show me deep constructor for my use and explain the code that would be greatly appreciated. I am really desperate for a solution.
If you have a pointer that is a member of a class, then all that pointer is, is a variable that stores an address to a block of computer memory.
If you were to make a shallow copy of that class...
say myClass2 = myClass1 for example, you end up with a new instance of the original class that has a pointer storing the same address of computer memory as the original class. So if you were to change the value of the pointer in myClass1, the pointer in myClass2 is also affected since both pointers are attached to the same address.
A deep copy will allow you to create a copy of myClass1 but give a new separate address to its pointer.