when we run this section of code, we get an infinite loop at c. The lines cout << b, c, and d are markers in the code to see where we are getting to, they can be ignored.
Your internal while loop never updates either of the variables that affect its logical conditions. If it gets into the inner loop at all, it is going to stay there. The closest you come to updating one of the variables that affect your loop conditions is on line 15 where you say rcounterb. This adds 1 to the value of rcounterb, but this result is thrown away. Perhaps you meant rcounterb = rcounterb + 1;?
do nothing to increment the variable. What you mean to do is:
rcounterb++;
or
rcounterb += 1;
. . . Same for rcountera. . .
Additionally, in your while statement, you mention that it should keep looping as long as match is equal to false, and yet you never do anything to switch that statement to true within the loop, so that "match" will always be false and thus the loop will never terminate on account of the "match" variable.
Right, that part works now, thank you all. However, there is a new problem. We are trying to calculate matches for a multitude of arrays, with random values on each array value each time. Whenever we run this code. matchcount equals the number of trials exactly, every time, no matter the number of trial.