uniqcpy1.cpp

We use cookies. Read the Privacy and Cookie Policy

uniqcpy1.cpp

#include ‹stl.h›

#include ‹iostream.h›

int numbers[8] = {0, 1, 1, 2, 2, 2, 3, 4};

int result[8] = {0, 0, 0, 0, 0, 0, 0, 0};

int main() {

 unique_copy(numbers, numbers + 8, result);

 for (int i = 0; i ‹ 8; i++) cout ‹‹ result[i] ‹‹ ;

 cout ‹‹ endl;

 return 0;

}