C# array pass in function like C++?

c#

Solution

Sure. However you can't modify pointers, so you would need to pass the offset separately. Also, you don't need to pass around the length, because all C# Arrays have a `.Length` property to get the array size.

void MyFunction(int[] A, int offset)
{
    MyFunction2(A, offset + 1);
}

Problem

Is there any way can C# pass an array in function like C++? In C++, we can pass the array plus offset and length very neat like below ``` void myFunction(int A[], int m) // m is length of A { myFunction2(A+1, m - 1); } ``` Can C# do it too?

Original source