why x is passed as call by reference?
Reference to c2 class
@kingshuk441
If you pass by copy then time is wasted in creating a copy of the object which is then passed to the function. So it is better to pass by reference here.
If your doubt is resolved please close it.