prain
asked on
How to copy a poiner type to a regular static object in C++
I have a class..
class AClass {};
I define:
AClass* ptrAClassInst = new AClass();
...
AClass anotherClassInst;
I want to copy the contents of the object pointed to by ptrAClassInst to anotherClassInst.
How?
class AClass {};
I define:
AClass* ptrAClassInst = new AClass();
...
AClass anotherClassInst;
I want to copy the contents of the object pointed to by ptrAClassInst to anotherClassInst.
How?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"Does not work." translates to what kind of error message?
ASKER
Oops sorry. My mistake. This is good. Thanks
ASKER
AClass anotherClassInst;
anotherClassInst = *ptrAClassInst ; //Does not work.