Header file ostream/istream problems
| Amnesiac (48) |
|
Trying to compile and link a few files; stuff from Stroustrup's Programming, Principles and Practice regarding the Date class
In the header file I have the following declarations:
1 2
|
ostream& operator<<(ostream& os, const Date& d);
istream& operator>>(istream& is, Date& dd);
|
and their definitions in the relevant .cpp file.
However, I get the error message (regarding both lines) that says
expected constructor, destructor or type converion before '&' token
What are the culprits?
|
|
|
| Amnesiac (48) |
|
|
Yes but it still displays the same error message
|
|
|
| Peter87 (3672) |
|
|
Have Date been declared before these two lines?
|
|
|
| Amnesiac (48) |
|
|
Yes, declared with all its member functions and defined in .cpp file
|
|
|