home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / c / cuj9301.zip / 1101096B < prev    next >
Text File  |  1992-11-03  |  533b  |  30 lines

  1. #include <iostream.h>
  2. #include "fa4.h"
  3.  
  4. void display(const char *s, const float_array &fa)
  5.     {
  6.     cout << s << " = " << fa << endl;
  7.     }
  8.  
  9. int main()
  10.     {
  11.     size_t i, size;
  12.     cout << "size? ";
  13.     cin >> size;
  14.  
  15.     float_array fa(size);
  16.     for (i = 0; i < fa.length(); ++i)
  17.         fa[i] = i;
  18.     display("fa", fa);
  19.     i = fa.length();
  20.     fa[i] = fa[i - 1] = 123;
  21.     display("fa", fa);
  22.     i = fa.length();
  23.     fa[i - 1] = fa[i] = 456;
  24.     display("fa", fa);
  25.     return 0;
  26.     }
  27.  
  28. ----------
  29.  
  30.