C# declaring a 2D array

前端 未结 5 1060
梦如初夏
梦如初夏 2021-01-19 17:13

I am trying to setup a 2d array in C# to act as a maze to move a character around, I am having a few issues initialising the array, I am trying to do the below

but t

5条回答
  •  梦毁少年i
    2021-01-19 17:50

    Ok, well here is some extract from the msdn :

     int[,] myArray = {{1,2}, {3,4}, {5,6}, {7,8}};
    

    extracted from MSDN multidimensional arrays

    you should also read up concerning Destructors, finalizers etc ... , I bet your coming from C++ ? Differences between the 2 languages arent always obvious :).

提交回复
热议问题