Overload the << operator for the Window class-- i.e., write a nonmember ostream-returning function that accepts a reference to an ostream object and a constant reference to a Window object and sends the following to the ostream: 'a (width x height) window' (without the quotes and with width and height replaced by the actual width and height of the window.
Here is my code:
#include <iostream>
using namespace std;
class Window
{
public:
friend ostream &operator << (ostream &,const Window &); //I think this is the line that produces errorneous results.
Window(int w, int h) : width(w), height(h) {}
private:
int width, height;
};