我已经从C转到C#.我有一个接受数组的函数.我想将二维数组的一维传递给此函数.
C代码将是: -
void array_processing(int * param);
void main()
{
int Client_ID[3][50];
/* Some
Processing
which fills
this array */
array_processing(&Client_ID[1]);
}
Run Code Online (Sandbox Code Playgroud)
现在,当我想在C#中做同样的事情时,我该如何传递这个数组呢?功能定义如下: -
private void array_processing(ref int[] param);
Run Code Online (Sandbox Code Playgroud)
和Array将声明为: -
int[,] Client_ID = new int[3,50];
Run Code Online (Sandbox Code Playgroud)
现在我怎样才能传递Client_ID[1]
给函数array_processing()
?
通过array_processing ( ref Client_ID[1])
喊叫"错误的指数"!