You have to decide what you mean by match. Let's assume that you mean that they must be the same size and have the same element at each position.
Then you have to go thru your loop and compare each element. If at least one does not match, then they are different.
1 2 3 4 5 6 7 8 9 10 11
bool match = true; // assume the entries match to begin with
for (int i = 0; match && i < 6; ++i) // loop while entries match
{
if (Array1[i] != Array2[i])
match = false; // clear the flag if the entries don't match
}
if (match)
cout << "Arrays match" << endl;
else
cout << "Arrays don't match" << endl;
I'm not sure what the error means, but there are a couple things wrong:
1. You need return 0; before your last closing brace
2. match is declared twice
What exactly don't you understand about for loops?