C++ Constructors Question:

Download Job Interview Questions and Answers PDF

What is shallow?

C++ Constructors Interview Question
C++ Constructors Interview Question

Answer:

A shallow copy just copies the values of the data as they are. Even if there is a pointer that points to dynamically allocated memory, the pointer in the copy will point to the same dynamically allocated object.

Download C++ Constructors Interview Questions And Answers PDF

Previous QuestionNext Question
Can you please explain the difference between copy constructor and an assignment operator?What is deep copy?