Calling methods with arrays in C++

My problem is that I have trouble calling the int

computePattern

method in int main(). I am able to use the

insertNumber

method. But i don't know how to use the

computePattern

method. The method is to compute the number of patterns and return the count. The pattern is that both adjacent numbers must be greater than 7. Hence, there are only 5 pairs to check as there are 10 numbers. For now the output is only the random arrays which worked, but I need to print out the number of patterns too. I need to use methods as it is required in the question.

You have different arrays in main than in computePattern. Just because they share a name doesn't mean they're the same variable. Each one of them is function scope. A better way is to pass in the address and size of the array.