I posted the wrong code before sorry i was missing a #include <fstream>
i am a bit sleepy now but i gotta hand in the program tomorrow and the only thing left was splitting the files !
i get this error the first time i try to use the overloaded <<:
main.cpp: In function ‘int main(int, char**)’:
main.cpp:550: error: no match for ‘operator<<’ in ‘std::cout << fifolist
<< is overloaded to print the list ..
fifo.h code is :
and fifo.cpp :Code:class fifo{ //Other prototypes in the middle ostream& operator<<(ostream&); };
Before i splitted the files i wasn't getting any errors.. Btw is there a tutorial online for splitting files with overloading >> or << ?Code:ostream& operator<<(ostream &ons, fifo &object) { vector <double>:: iterator theiterator; if (object.list_size()==0){ cout<<"I fifo list einai keni!"; } else cout<<endl<<"Fifo List :"; for(theiterator=object.list_begin();theiterator!=object.list_end();theiterator++) cout<<" "<<*theiterator; cout<<endl; }