I think the culptrit is that iostream is not included in your Date.cpp file, but more information would be needed for me to say otherwise.
I tried doing this to see if it worked:
1 2 3 4 5 6 7 8 9 10 11 12
#include <iostream>
class Date
{
std::ostream& operator<<(std::ostream& os, const Date& d);
std::istream& operator>>(std::istream& is, Date& dd);
};
int main()
{
return 0;
}
g++ gave me this error:
code.cpp:5:60: error: 'std::ostream& Date::operator<<(std::ostream&, const Date&)' must take exactly one argument
code.cpp:6:55: error: 'std::istream& Date::operator>>(std::istream&, Date&)' must take exactly one argument
So I tried this:
1 2 3 4 5 6 7 8 9 10 11 12
#include <iostream>
class Date
{
std::ostream& operator<<(const Date& d);
std::istream& operator>>(Date& dd);
};
int main()
{
return 0;
}
Yeah thanks ne555
Maybe Amnesiac will figure out the solution now?
I was just trying to give him something that worked. Could you take a look at the actual question since you fixed mine?