How to copy a row of values from a 2D array into a 1D array?

前端 未结 6 2149
醉话见心
醉话见心 2020-12-05 08:17

We have the following object

int [,] oGridCells;

which is only used with a fixed first index

int iIndex = 5;
for (int iLoop         


        
6条回答
  •  渐次进展
    2020-12-05 08:47

    "But if the array was being heavily manipulated then a single dimension array would be more efficient than a multi dimension array."

    I did some profiling of exactly this last summer and was surprised to see no significant difference in performance between a 2D and 1D array.

    I didn't test the performance of a jagged array.

提交回复
热议问题