void evaluate(int&answer,int&guess,int& black, int& white, int& length){
for(int i = 0, i<length, i++){
for(int j=0,j<length,j++){
if(nthDigit(answer,i)==nthDigit(answer,j){
black++;
}
}
cout<<"You earn "<< black<<" pegs and "<<white<<"pegs";
}
It says that i and j must have a constant value. The function nthDigit is from another part of the program that just tells me what is in a certain position and returns it. I just want a nested for loop so I can compare the values of two things to see if they match. I defined this function above the main could that be a problem? I have the length being asked for another function that is being called in the main.