Labeled statement

Control flow / Jump statements

#include <iostream>
using namespace std;

int firstMatchValue = -1;
int array1[] {1, 2, 3};
int array2[] {2, 3, 4};

for (int value1 : array1) {
    for (int value2 : array2) {
        if (value1 == value2) {
            firstMatchValue = value2;
            goto stop;
        }
    }
}
stop:
//firstMatchValue is 2

cout << firstMatchValue;