C++ Assume that a class named Window has been defined, and it has two int member variables named width and height. Write a function that overloads the >> operator for the Window class. The function should accept a reference to an istream object and a reference to a Window object as arguments. The function should read two values from the istream object, into the width and height member variables respectively. Don't forget to have the function return the proper value as well. Assume that the function has already been declared as a friend in the Window class with the following statement: friend istream &operator >> (istream &, Window &);
C++
Assume that a class named Window has been defined, and it has two int member variables named width and height. Write a function that overloads the >> operator for the Window class. The function should accept a reference to an istream object and a reference to a Window object as arguments. The function should read two values from the istream object, into the width and height member variables respectively. Don't forget to have the function return the proper value as well. Assume that the function has already been declared as a friend in the Window class with the following statement: friend istream &operator >> (istream &, Window &);
No hand written and fast answer with explanation
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
Write this in C++ only.