c++ - Get Index Given Row and Column -


is there formula can used index given current column , row? following have far. problem is, however, code works first row...

for (int = 0; < rows; i++) {     (int j = 0; j < columns; j++)     {         index = * (columns - 1) + j;     } } 

this should work:

        index = * columns + j; 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -