Z
Zhongqi Pan
I am facing a problem-
I am using
f1(this)
to pass a class object pointer to a function ( say f1)
f1 is defined as follows
f1 (classB *p1)
{
classB *p2 = new class (*p1);
..........
does not transfer the object pointer by the this pointer to p2 - it only
transfers the data values. I need to transfer p1 to p2 because p1 kepts
pointing to old objects and creates problem.
note: classB is the base class of the class whose object is passed to in
f1(this)
Any suggestion ?? Is copy constructor required? ( I have tried it but it
does not work for pointer objects)
If more clarifications are requirted please let me know.
Thank you
I am using
f1(this)
to pass a class object pointer to a function ( say f1)
f1 is defined as follows
f1 (classB *p1)
{
classB *p2 = new class (*p1);
..........
does not transfer the object pointer by the this pointer to p2 - it only
transfers the data values. I need to transfer p1 to p2 because p1 kepts
pointing to old objects and creates problem.
note: classB is the base class of the class whose object is passed to in
f1(this)
Any suggestion ?? Is copy constructor required? ( I have tried it but it
does not work for pointer objects)
If more clarifications are requirted please let me know.
Thank you