My question is similar to Getting a sub-array from an existing array although a little different notion is very important in my case - I can't use memory copying.
Let's say I have array X
of 10000 elements, I need array Y
that would contains 9000 elements from X
, starting from X
's index 500.
But I don't want to copy part of X
to new array Y
, so I don't want to use Array.Copy, Array.Clone, System.Block.Copy, IEnumerables etc. I want Y
to be reference to X - Y[0]
would be in fact X[500]
, Y[1]
corresponds to X[501]
, ..., Y[9000]
is X[9500]
.
Thus, for example changing value of X[100]
would at the same time change value of Y[600]
. How can I achieve this in C#?