Friendship and inheritance - C++ Tutorials

Friendship and inheritance - C++ Tutorials

瀏覽:422
日期:2025-10-02
In this example, class Rectangle is a friend of class Square allowing Rectangle's member functions to access private and protected members of Square. More concretely, Rectangle accesses the member variable Square::side, which describes the side of the squ...看更多