brand new c++ user arrays

Mar 30, 2014 at 5:54pm
hi can anyone help me with the implementation of is_not_duplicate please? need to enter numbers in an array, and as the array is read print it, as long as it is not a duplicate of a number already entered?
brand new to c++ so help would be appreciated

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int main()
{  const int SIZE=50;
    int array[SIZE];
    int cnt = 0;  // Number of entries in the array
    int temp;

    cout << "Enter a list of numbers: ";
    for (int i=0; i<SIZE; i++)
    {    cin >> temp;
          if (is_not_duplicate (array, cnt, temp))
              array[cnt++] = temp;  // Not a duplicate, add to the array
    }
    getch();
    return 0;
} 
Topic archived. No new replies allowed.