home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / test / regression / adjdiff0.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  644b  |  32 lines

  1. // STLport regression testsuite component.
  2. // To compile as a separate example, please #define MAIN.
  3.  
  4. #include <numeric>
  5. #include <iostream>
  6.  
  7.  
  8. #ifdef MAIN 
  9. #define adjdiff0_test main
  10. #endif
  11.  
  12. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  13. using namespace std;
  14. #endif
  15.  
  16. int adjdiff0_test(int, char**)
  17. {
  18.   cout<<"Results of adjdiff0_test:"<<endl;
  19. int numbers[5] = { 1, 2, 4, 8, 16 };
  20.  
  21.   int difference[5];
  22.   adjacent_difference(numbers, numbers + 5, (int*)difference);
  23.   int i;
  24.   for(i = 0; i < 5; i++)
  25.     cout << numbers[i] << ' ';
  26.   cout << endl;
  27.   for(i = 0; i < 5; i++)
  28.     cout << difference[i] << ' ';
  29.   cout << endl;
  30.   return 0;
  31. }
  32.