// methods and friends of ivec // #include #include #include "ivec.h" // Here is the definition of the overloaded << operator // used to send the contents of an ivec to an output stream ostream &operator<<(ostream &o, const ivec &v) { for (int i=0;i>(istream &in, ivec &v) { char c; char buff[1000]; // clear out the vector first v.empty(); // read in a line of text in.get(buff,1000,'\n'); in.get(c); // read the newline // create a string string istrstream ist(buff,1000); int x; while (ist >> x) { v.append(x); } return(in); }