I agree with Lee; arrays or vectors should have been covered before you got this assignment. Please give us some more detail as to which you're using.
And I certainly hope it's vector; otherwise you have the bad luck of being stuck in a C course where the instructor thought "Let's use cout instead of printf and call it C++".
That does not bode well.