home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / libg++-2.7.1-base.tgz / libg++-2.7.1-src.tar / fsf / libg++ / libstdc++ / tests / tvector.cc < prev    next >
C/C++ Source or Header  |  1994-11-29  |  441b  |  21 lines

  1. #include <vector.h>
  2. #include <iostream.h>
  3. #include <algo.h>
  4.  
  5. main ()
  6. {
  7.   cout << "Fill of C array:\n";
  8.   char x[50];
  9.   fill (x, x+50, '/');
  10.   fill (x+1, x+49, '*');
  11.   copy (x, x+50, ostream_iterator<char>(cout));
  12.  
  13.   cout << "\nFill of vector<char>:\n";
  14.  
  15.   vector<char> cvec;
  16.   cvec.insert (cvec.begin(), 50, '/');
  17.   fill (cvec.begin()+1, cvec.end()-1, '-');
  18.   copy (cvec.begin(), cvec.end(), ostream_iterator<char>(cout));
  19.   cout << endl;
  20. }
  21.