Hi there, I would like to ask about an array of any comparing another array of the same type. Lets take an int array for an example, the first one comparing with the second one, they have the same number but different position and i would like to print "Same number diff position, try again !". Or sth similar to it. Can anyone show me an sample code? Thanks.
int firstArray[10];
int secondArray[10];
for (int i=0;i<=9;i++){
for (int j=0;j<=9;j++){
if (firstArray[i]==secondArray[j]){
if (i==j) //do what you want to do if there're on the same position
else //do what you want to do if there're on different positions
}
}
}