i have a problem :
Write the definition of a function, isReverse , whose first two parameters are arrays of integers of equal size, and whose third parameter is an integer indicating the size of each array. The function returns true if and only if one array is the reverse of the other. ("Reverse" here means same elements but in reverse order.)
this is the code i wrote:
bool isReverse(int x[],int y[],int z){
int i,b;
for(i=0;i<z;i++)
if(x[i]==y[z-i-1])
b=1;
else b=0;
return b;
}
i thought i did it right but its not and i'm not sure whats wrong. one of the error messages i was given is:
It seems that your function fails to check the ends of the arrays. Please revise your code.
i'm not sure what that mean. can somebody help me. thanks in advance.