CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2009
    Posts
    25

    copy constructor

    Hi,
    just a quick question.
    if i use a copy constructor in the following way.

    A a;
    A a1(a)

    does it mean that any future updates made in member variable of class A using object 'a',
    will also be reflected in a1?

    thanks

  2. #2
    Join Date
    Jul 2008
    Posts
    70

    Re: copy constructor

    It really depends on the copy constructor. But in general no. The copy constructor usually does a copy/clone of the object, it usually does not point to the other object.

    Now of course this all depends on what the implementer of the copy constructor did.

    Make sense?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured