Shallow and deep copy

i am not able to understand that why sir has made other pointer for deep copy in car(car &X)

could u tell the timestamp from the video about which u are talking of

I assume u are talking of the char array which was created in car(car&X) function

in the shallow copy code we see that updating one object value changes all objects which are made using copy constructor or are initialised by the same obj

in that case if we want updated to happen independently like BMW and GMW happen to each individual object
for that reason we are allocating a new memory location where a new char array is formed and that reference is stored for the object

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.