14.2: Friends of Classes 11220

Solution by nowiita

class Window
{
private:
int width;
int height;
public:
Window(int w, int h)
{
width = w;
height = h;
}
friend bool areSameSize (Window, Window);
};
bool areSameSize (Window obj1, Window obj2)
{
bool same = false;
if (obj1.width == obj2.width && obj1.height == obj2.height)
same = true;
return same;

}

No comments:

Post a Comment