My question is similar to Getting a submatrix from an existing array , although in my case another concept is very important - I can not use memory copying.
Let's say I have an X array of 10,000 elements, I need an Y array that will contain 9,000 elements from X , starting at X index 500.
But I do not want to copy part X to a new array Y , so I do not want to use Array.Copy, Array.Clone, System.Block.Copy, IEnumerables, etc. I want Y to refer to X - Y[0] would actually be X[500] , Y[1] matches X[501] , ..., Y[9000] is X[9500] .
Thus, for example, changing the value of X[100] at the same time will change the value of Y[600] . How can I achieve this in C #?
source share