Hi guys, doing some C++ homework atm. I was told to "Implement and test the following class." but I have no idea what that entails in the context of this program. I am also a bit lost on what friend osteam/istream operators mean. Essentially I don't know where he wants us to start, my brain keeps reading it as a program that's finished for some reason and so I don't know what I need to add.
And I'm assuming he wants you to finish writing the member functions of the class. Here a small little example of the ostream overload I wrote to show you what that can be done.
#include <iostream>
class C
{
public:
C(int a, int b) : a(a), b(b) {}
friend std::ostream &operator<<(std::ostream& os, const C& c)
{
os << "A: " << c.a << " - B: " << c.b;
return os;
}
private:
int a;
int b;
};
int main()
{
C c(10, 15);
std::cout << c << '\n';
return 0;
}