X.price is reference to d class

x.price is reference to d class so when

Car(Car &x){
price = x.price

here x is reference to the same bucket as d , so
we know that price is a private member how come we are able to access x.price . Why is there no error

hello @sinhadivyam19
pls share the complete code , that u r referring to.

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.