Passing 2-D array as argument

后端 未结 6 883
误落风尘
误落风尘 2020-12-31 14:03

I am trying to pass a 2-d array to a function which accept a pointer to pointer. And I have learnt that a 2-d array is nothing a pointer to pointer(pointer to 1-D array). I

6条回答
  •  甜味超标
    2020-12-31 14:37

    Another templated solution would be:

    template
    void myFunction(int array[N][M])
    {
    }
    

提交回复
热议问题