dck:
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.
Documentation on MQL5: Language Basics / Data Types / Structures and Classes
- www.mql5.com
Language Basics / Data Types / Structures and Classes - Documentation on MQL5
investeo:
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;
...
};

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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