iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
the code you posted won't even compile, as m and n aren't initialised yet at the time you first use them.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
yah, misread it. Looked like you had them defined inside a method, in which case it wouldn't have compiled.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
You're problem isn't, however, in updating the instance variable. m and n are getting updated just fine, with what you are doing. What is not working, is that the array is not dynamically changing size along with those variables. That is not the way it works. You need to redefine the array to get it to change its size.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Also, what is this line?
while (m < 10 || m > 100);
You do realize that this while statement will hang forever if m is less than 10 or greater than 100, right?
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494