2 ms·
I often find 0-based indexing sneaking into other places too. For example, imagine I want to fake an nm 2d matrix M with an array A, with nm elements Then wit
by CJefferson 15y ago
I often find 0-based indexing sneaking into other places too.
For example, imagine I want to fake an nm 2d matrix M with an array A, with nm elements
Then with 0-indexing, M[i][j] is stored at A[im+j]. With 1-indexing, M[i][j] is stored at A[(i-1)m+j].