'Why looping through array gives non existent value?
I have 2 multidimensional arrays filled with x and y coordinates. Im comparing both arrays to find a match in nested loop like this
int order;
order = 0;
float c[4][2];
for (int i = 0;i <= sizeofarrB; i++ ) {
for (int j = 0;j <= sizeofarrA; j++ ) {
if (a[j][0] == b[i][0] && a[j][1] == b[i][1]){
printf("testx = %f y = %f\n " , a[j][0], a[j][1]);
printf("testx = %f y = %f\n", b[i][0], b[i][1]);
c[order][0] = b[i][0];
c[order][1] = b[i][1];
order++;
}
}
}
these are values of first array
these are values of second array
and these are the values that i get from running that nested loop

i have no idea how to fix the code to get correct values
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


