Sorry, that was my mistake - I failed to close the two open brackets. It should go as follows:
for (int i = 0; i < 8; i++) {
if (a[i] == goalTotal) {
cout << endl << "Player Wins" << endl;
win = true;
break;
}
}