Copy Constructor - Logical Copy Constructor

Logical Copy Constructor

A logical copy constructor makes a true copy of the structure as well as its dynamic structures. Logical copy constructors come into the picture mainly when there are pointers or complex objects within the object being copied.

It can be seen from the above figure that in a logical copy constructor, a new dynamic - member variable is created for the pointer along with copying the values.

Read more about this topic:  Copy Constructor

Famous quotes containing the words logical and/or copy:

    It is possible—indeed possible even according to the old conception of logic—to give in advance a description of all ‘true’ logical propositions. Hence there can never be surprises in logic.
    Ludwig Wittgenstein (1889–1951)

    Knowledge is what we get when an observer, preferably a scientifically trained observer, provides us with a copy of reality that we can all recognize.
    Christopher Lasch (b. 1932)