Link to home
Start Free TrialLog in
Avatar of prain
prainFlag for United States of America

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?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of prain

ASKER

AClass*   ptrAClassInst =  new AClass();
AClass   anotherClassInst;

anotherClassInst =  *ptrAClassInst ;    //Does not work.
"Does not work." translates to what kind of error message?
Avatar of prain

ASKER

Oops sorry. My mistake. This is good. Thanks