Search:

Type: Posts; User: PhHein

Search: Search took 0.08 seconds.

  1. [SOLVED] Re: Inserting characters from string into 2d array?

    Aha! You're not using the loop variables as index!

    myArray[a][b] = charArray[nextChar];

    You're using x and y which are out of bounds.
  2. [SOLVED] Re: Inserting characters from string into 2d array?

    What does "doesn't seem to work" mean? Did you blow up your toaster? What error messages/stack traces do you get now?
  3. [SOLVED] Re: Inserting characters from string into 2d array?

    You have to stop looping as soon as nextchar will be >= charArray.length
  4. [SOLVED] Re: Inserting characters from string into 2d array?

    You're iterating x*y times, which is likely more than charArray.length, because you round up. So nextchar will be >= than charArray.length, causing the Exception.
Results 1 to 4 of 4