Copy Constructor Doubt

In the above code given by sir while making a copy of the car E as F and then changing the first letter of the name data member (of F), why didn’t the first letter of name E is not changed (because name is a char array which can act as pointer) ?

This doubt is in reference to the shallow and deep copy concept.

@Rooopak_Sharma
The changes would have been reflected if we copied the array pointer value. We copied the data of the name string using strcpy( ) , so only the data gets copied. The pointers of E and F are pointing to two seperate strings which have the same data. Any modification in one of these strings does not reflect in the other one as they are seperate.

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.