As stated by DataMiser your post are not clear one what you wish to accomplish. There are many different ways of accomplishing things and when it is not clear what your goal is people here can keep trying to help you but get nowhere.

Your initial post looks like a simple counter in which an int could be used so I have some questions.
-Is there a reason you need to use an array?
-Does each position in the array have a rule? (Ex. testArray[0] = 1 * Value, testArray[1] = 2 * Value, testArray[2] = 4 * Value, testArray[3] = 8 * Value)
-What exactly is the purpose of the application? You say to find the match to the mainArray but for what reason? There could be a more efficient way of doing this.

If you have to use array with the limited information you provide I can think of a way to do this by:
- Initializing an int Array
- Creating a for loop
- Breaking counter value into separate chars and assigning each into a position in the testArray
- Check testArray against mainArray (If all values match break out of loop)

Does not seem like the most efficient way of doing it but would get the job done or at least what seems like is your goal.