www.webdeveloper.com
Results 1 to 4 of 4

Thread: stack overflow when creating a 2d array

  1. #1
    Join Date
    Dec 2002
    Posts
    30

    stack overflow when creating a 2d array

    I'm getting a stack overflow in the following code. I tried setting the navArray size to 6 in the declaration but that didn't help. Any ideas?

    var pages = new Array("h", "n", "w", "r", "m", "c");
    var navArray = new Array();

    pageCount = pages.length;
    for (i=0; i<pageCount; i++) {
    page = pages[i];
    navArray[page] = new Array();
    }
    Last edited by bisqui; 01-10-2003 at 04:24 PM.

  2. #2
    Join Date
    Dec 2002
    Location
    Switzerland
    Posts
    428
    could be that:

    navArray[page] maybe you should use i instead of page
    navArray[i] =

    just a thought.


    Swon

  3. #3
    Join Date
    Dec 2002
    Posts
    30
    i stared at this for over an hour before I posted the question. Two minutes after I posted, I figured it out. Typical. It had nothing to do with the 2d array. There was a bit of code elsewhere that was being affected by a naming conflict.

  4. #4
    Join Date
    Dec 2002
    Location
    Switzerland
    Posts
    428
    Indeed a typical case of coding, figured after posting


    Swon

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles