What is copy constructor?

devquora
devquora

Posted On: Mar 17, 2020

 

Just like the name, a copy constructor is one the other constructors used for creating a copy of an object of class type that has been in existence already. The translator known as compiler makes available a default copy constructor for every class. The named constructor comes from creating while copy simply means new object from an existing one. In a simpler term, a copy constructor creates a copy of an already existing or available object.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    C++ Interview Questions

    Explain what is OOP?

    Object-oriented programming (OOP) is a type of computer programming, also more commonly known as software design, in wh..

    C++ Interview Questions

    What is the difference between #import and #include in C++?

    The statement #include is used in C++ to include the source file or import the header files containing definitions of f..

    C++ Interview Questions

    What is ‘this’ pointer?

    The ‘this’ pointer is passed as a hidden argument to all the non-static member method calls and is available as a l..