Conversion between Objects of Different Classes
As the compiler does not know anything about the user-defined type, the conversion instructions are to be specified in a function. The function can be a member function of the source class or a member function of the destination class. We will consider both the cases.
Consider a class DistFeet which stores distance in terms of feet and inches and has a constructor to receive these. The second class DistMetres store distance in metres and has a constructor to receive the member