// header file that illustrates the use of friends class list; class cell; class list // a list of integers { private: cell* front; // points to first cell public: void insert(int x); // inserts new cell to front of list void print(); // prints data in list list(); ~list(); // destructor : must erase all cells too! }; // end of class list class cell // object representing a list cell { private: int head; // data stored in cell cell* tail; // pointer to next cell/rest of list public: cell(int h, cell* t); // constructor ~cell(); // destructor friend void list::print(); // friendly functions that can access friend list::~list(); // the private vars of cell class };