posted 22 years ago
At a guess though, chances are good that you're getting an ArrayIndexOutOfBoundsException from c[m], since there doesn't appear to be bounds checking on this. (Unless j+1 is the size of array c.) You might want to put proper bounds checking into the loop:
for(m = 1; m < j + 1 && m < c.length; m++)
Incidentally, arrays start at index 0, not 1, so there's a good chance you want to start with m = 0 rather than m = 1.
"I'm not back." - Bill Harding, Twister