I would like to know if there is a way to get a ref to an array element in c# .
Something like this but without the pointers :
SomeClass *arr[5]; ... SomeClass** p = &arr[2];
So far I got this :
SomeClass arr[] = new SomeClass[5]; // Put something in the array SomeClass p = arr[2]; // This will give me the initial object, not the array ref
https://stackoverflow.com/questions/67030692/is-there-a-way-to-get-a-reference-to-a-c-sharp-array-element April 10, 2021 at 12:05PM
没有评论:
发表评论