Qt World Summit: Register Today!

[SOLVED]Qt Creator 2D Array not saving values at right spot

  • Hello Forum :)

    I have a little problem with Qt Creator, now I hope I'm simply over seeing something.
    I am writing to a 2D array with a for loop to [i,0], so all first spots get filled with 0-size.
    now in NetBeans this is no problem at all, but for some reason in Qt Creator, it always saves one spot further, I even tried using a const int zero = 0, but no budge. it saves the 1 at [1,1] the 2 at [2,2] and so on.. I have these two pictures with the coding plus the debugger showing the array.


    @Matrix[0][0] = 0;
    const int zero = 0;
    for(i = 1; i < lengthA + 1; i++)
    Matrix[i][zero] = i;
    for(j = 1; j < lengthB + 1; j++)
    Matrix[zero][j] = j;@

    the funny/confusing part is, that the 2nd for loop works and saves it in the right place :?

    Thanks for any help in advance :)


  • omg, I am so stupid lol

    I see where the problem was, sorry to anyone that took the time to read this :(

Log in to reply