home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / EXAMPLES.ZIP / EX7.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  258 b   |  17 lines

  1. // ex7.cpp:   Using the List class
  2. // from Chapter 6 of Getting Started
  3. #include "list.h"
  4.  
  5. main()
  6. {
  7.    List l(5);
  8.    int i = 0;
  9.  
  10.    // Insert the numbers 1 through 5
  11.    while (l.put_elem(i+1,i) == 0)
  12.       ++i;
  13.    l.setn(i);
  14.  
  15.    l.print();
  16. }
  17.