Hey I'm trying to compile a project for class (C++/linux) but I can't figure out what this g++ error means:
time.h:22: error: ISO C++ forbids declaration of 'istream' with no type
time.h:22: error: 'istream' is neither function nor member function; cannot be declared friend
time.h:22: error: expected ';' before '&' token
The code it's referencing is a public function definition:
Shouldn't istream be defined in the iostream header file?
Thanks in advance for any help, and let me know if more info is needed.
time.h:22: error: ISO C++ forbids declaration of 'istream' with no type
time.h:22: error: 'istream' is neither function nor member function; cannot be declared friend
time.h:22: error: expected ';' before '&' token
The code it's referencing is a public function definition:
Code:
#include <iostream>
class Time
{
private:
int hour, minute;
bool am;
Time() {};
friend class Appointment;
public:
Time(int, int, bool);
int getHour();
int getMinute();
bool isAM();
bool operator<(Time);
[B]friend istream& operator>>(istream& istr, Time t);[/B]
};
Thanks in advance for any help, and let me know if more info is needed.
Comment