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
Post a Comment