0

Hi i need help on searching an array for a match. They can be in any order, and does not need to be in a sequence. The theArray has 6 numbers in each row, with 10 lines (i have made 2 to keep things simple). The randArray has 8 numbers. I need to check these 8 numbers with the 6 numbers in each row of theArray, then increment the count if there are matches found on each line

```
#include <iostream>
using namespace std;
int main()
{
int theArray[1][2][12] = {{{1,1,1}}, {{1,1,2}}, {{1,1,3}}, {{1,1,4}}, {{1,1,5}}, {{1,1,6}},
{{1,2,10}},{{1,2,11}},{{1,2,12}},{{1,2,13}},{{1,2,14}},{{1,2,15}}};
int randArray[1][8] = { 1 2 3 4 5 12 7 8 };
int count[10];
for (int i = 0; i < 1; i++)
{
for (int j = 0; j < 10; j++)
{
for (int k = 0; k < 6; k++)
{
for (int check = 0; check < 8; check++)
{
for (int m = 0; m < 6; m++)
{
if (randArray[i][check] == theArray[i][j][m])
{
count[l] += 1;
}
}
}
}
}
}
cout << count[0] << endl
<< count[1];
return 0;
}
//---------------------------------------------------------------------------
```

So it will display:

5 matches

2 matches

*Edited 6 Years Ago by Vllinator*: n/a