int correctdigits(int a[],int g[], int size){
int count = 0;
for (int i = 0; i < 4; i++){
for (int j = 0; j < 4; j++){
if(a[i] == g[j]){
count++;
}
}
}
return count;
}
//spot function
int correctspots(int a[], int g[], int size){
int countx = 0;
for(int i = 0; i < size; i++){
if(a[i] == g[i]){
countx++;
}
}
return countx;
}
but I get this error: expected primary expression before 'int'
but I get this error: expected primary expression before 'int'
Which "int"??
looks like it is the "int" in the "cout" statement that should not be there. All you need when calling a function like this the return value is not needed. Just the function's name.
Next time post the complete error message. And because the line numbers do not always match point out which line it refers to.