//C has no break with a label:
//goto leaves both loops at once
int firstMatchValue = -1;
int array1[] = {1, 2, 3};
int array2[] = {2, 3, 4};
for (size_t i = 0; i < 3; i++) {
for (size_t j = 0; j < 3; j++) {
if (array1[i] == array2[j]) {
firstMatchValue = array2[j];
goto stop;
}
}
}
stop:
//firstMatchValue is 2
printf("firstMatchValue is %d\n", firstMatchValue);