Hi, how do I define an assignment operator which is supposed to copy all member attributes of one object to another where both objects are given as pointers?
Example: CLASS_A *source = new CLASS_A; .... CLASS_A *dst = new CLASS_A; dst = source; I want that all attributes of object "source" are also assigned to object "dst". My idea was to define the operator in the header file of class CLASS_A: class CLASS_A { public: void operator=( const CLASS_A & ); ... private: int a; ... } And in the source code: void CLASS_A::operator=( const CLASS_A &dst ) { a = dst.a; } However, this doesn't work since the operator is never invoked. What did I wrong? Thank you Chris _______________________________________________ Help-gplusplus mailing list Help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus