I want to pass an array to a function with specific index in C#, like we do in C++, something like below:
void foo(int* B) {
// do something;
}
int main() {
int A[10];
foo(A + 3);
}
In this case suppose A
starts with base address 1000
, then B would be 1000+(sizeof(int)*3)
. The answer in this link uses Skip()
function call but in this case B
should be of type IEnumerable<int>
and on calling Skip()
with ToArray()
it creates a copy with different base address, but I want to pass this same array to function foo. How can we do that in C#?