Greetings everyone. I'm in need of some experiance here as how to deal with dynamic arrays with Objects.
I've a class 'SA', consisting of several objects 'Obj1', 'Obj2' etc...
Within the class I have a dynamic array 'SA_Array' which I initialize in the following manner where size sets its length:
double * SA_Array;
SA_Array = new double [size];
Now I've been trying to use the '=' operator on the above objects to make copies of the array in each object. Unfortunatly I've realised that it only equalizes the pointer and hence if I modify the array in one object, all the object SA_Array's are modified the same... Essentially leaving me with only one copy on the array.
e.g. Obj1.SA_Array == Obj2.SA_Array...
Are there any good suggestions as to how to overcome this and achieve object specific copies of SA_Array?