home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_07 / 1107121a < prev    next >
Text File  |  1993-05-06  |  347b  |  25 lines

  1. //
  2. // list.h - list interface using a friend class
  3. //
  4.  
  5. class listnode
  6.     {
  7.     friend class list;
  8.     listnode(unsigned n, listnode *p)
  9.         : number(n), next(p) { }
  10.     unsigned number;
  11.     listnode *next;
  12.     };
  13.  
  14. class list
  15.     {
  16. public:
  17.     list(unsigned n);
  18.     ~list();
  19.     void add(unsigned n);
  20.     void print();
  21. private:
  22.     listnode *first, *last;
  23.     };
  24.  
  25.