Your second loop should use j as a subscript for your array, not i
If you wrote
for( int i = 0; i < MAXSIZE; ++i )
rather than declaring the variable at the start (in C style), then a newer compiler would have made i go out of scope, and you would have gotten a nice warning about using the i subscript where you shouldn't have.
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Offline 7,164 posts
since Dec 2005