In this code, why can I access the private member of an object without a compiler error?
class Cents { private: int m_nCents; public: Cents(int nCents=0) { m_nCents = nCents; }
cSource.m_nCents is private, why can I do the following:
m_nCents = cSource.m_nCents; // return the existing object return *this; }
source share