Shallow copy cnstructor

can you please write the shallow copy constructor that is default copy for this example>>>>[ class is car and we want to copy car name (using dynamic memory allocation)] same example as in the video


this is the code. please covert deep copt to shallow copy .

@niketagarwal10 you can read up about shallow and deep copies here https://www.learncpp.com/cpp-tutorial/915-shallow-vs-deep-copying/ it has an elaborate example as well. I am not sure what do you mean when you say to “convert” it to a shallow copy. If any doubt still persists after seeing the above example let me know.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.