Instance of an instance

Any way to make an instance from another instance of a class?

1
2
3
4
5
  class CLASS
  [...]

  CLASS a;
  CLASS b = new a;
1
2
3
4
5
  class CLASS
  [...]

  CLASS a;
  CLASS b = new a;

or
CLASS b(a);

What you need to be careful with is copy constructor/operator:
read: http://www.cplusplus.com/articles/y8hv0pDG/
Last edited on
Thank you
Topic archived. No new replies allowed.