Iterating one dimension array as two dimension array

后端 未结 3 1014
[愿得一人]
[愿得一人] 2020-12-28 09:22

I have,

int[10] oneDim = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, index = 0;

as shown here, we create the the two dimensional one from the origin.

3条回答
  •  死守一世寂寞
    2020-12-28 09:38

    The two numbers you're showing could be computed, in the order you're showing them in, as index/2 and index%2 respectively. Is that what you mean by "the issue"?

提交回复
热议问题