question on function and passing it an array
this is what i have so far and im getting errors.....
if anyone can help I would appreciate it
this is what i have so far and im getting errors.....
Code:
int dup_mark(int a, int b[]);
int scores[20];
int value;
cout << "Enter list: ";
int i;
for( i = 0; i < 20; i++) {
cin >> value;
if(value == 0) {
break;
}
scores[i] = value;
}
int n = i; //save i because that is the number of process we need.
//getting input is done
dup_mark(n,scores[]);
int dup_mark(int a, int b[])
{
for(int dup_loop = 0;dup_loop < a; ++dup_loop)
{
for(int dup2 = dup_loop+1; dup2 < a; ++dup2)
{
if (b[dup2] == b[dup_loop])
{
b[dup2] = 0;
}
}}}
Comment