Why do I have to have these things that are marked in bold below in the code?
I know I can't have void keeper::........, but why do I have to have keeper beofre the code?Code:class keeper { private: int hours; int minutes; public: keeper(); keeper(int s, int p); void addKeeper(int, int); void writeKeeper(keeper &k); keeper getKeeper(keeper &h, char *name); keeper operator+(const keeper &k) const; void show(); ~keeper() {}; }; . . . keeper keeper::getKeeper(keeper &h, char *name) { ifstream fin; fin.open(name); for(int i=0;i<3;i++) { switch(i) { case 0: fin >> h.hours; break; case 1: fin >> h.minutes; break; } } fin.close(); return h; }
thanx




Reply With Quote