// A simple, safe and efficient 8 character Buffer -- Buffy the Bug slayer #ifndef BUFFY_H #define BUFFY_H #include using namespace std; class Buffy { private: char buffer[8]; int len;//number of characters placed in buffer public: Buffy();//default constructor Buffy(const Buffy & b); // copy constructor inline friend ostream& operator <<(ostream& out, Buffy & b); //output the len characters in the buffer inline friend istream& operator >>(istream& in, Buffy & b); //read line and store no more than the first 8 characters virtual ~Buffy(){} //Just in Case // STUB bool operator==(const Buffy & b)const{return false;}// test for equality }; // Buffy Buffy::Buffy():len(0){for(int i=0;i<8;i++)buffer[i]='\0';} Buffy::Buffy(const Buffy & b) { len=b.len; for(int i=0;i<8;i++) buffer[i]=b.buffer[i]; } //Define friends of Buffy //TBD #endif