menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Shallow Co...
source image

Medium

1M

read

375

img
dot

Image Credit: Medium

Shallow Copy and Deep Copy | Copy Constructor| C++|OOPs Concept | Interview Preparation

  • Copy constructor is invoked when a new object is created with the help of an existing object.
  • Shallow copy occurs when a default copy constructor is used, and the objects point to the same memory location.
  • Deep copy solves the issue of shallow copy by assigning a different memory location to the new object.
  • To perform deep copy, a custom copy constructor needs to be defined.

Read Full Article

like

22 Likes

For uninterrupted reading, download the app