How to duplicate objects like CObject???
Hi
o1 and o2 are now referring to the same object - that is the proper way, I'm not complaining.
But how do I copy an Object?
thank you
via copy constructor or operator overloading. see e.g.
- www.mql5.com
via copy constructor or operator overloading. see e.g.
This still means doing it by hand for every property, right?
There is no copy() or clone() to do the work for me, (risking to forget a property) ?
like:
CObject(const CObject &obj){u=obj.u;
v=obj.v;
w=obj.w;
...
};
Hi
CObject *o1 = new CObject(); CObject *o2 = o1;o1 and o2 are now referring to the same object - that is the proper way, I'm not complaining.
But how do I copy an Object?
thank you