Print all of the numbers in an array, but only print the first one in a consecutive group of identical numbers.Example
const int A[] = {2, 7, 7, 7, 1, 1, 8, 8, 8, 2, 8, 8};
unique_copy(A, A + sizeof(A) / sizeof(int), ostream_iterator
// The output is "2 7 1 8 2 8".
Loading...