K
Kresimir Spes
Is the following C code possibile in C# (without the pointers ofcourse)
int a[1000];
int* b=&a[100]; // or a+100
b[0]=0;
what I would like to do is create a new int[] array object and have it
point at the beginning of the 100th element of array "a" and set its
size to 100 elements, so I can pass that reference array to another
function that does a foreach loop. I only want to perform operations on
those 100 elements, not the whole array.
// Yes, I can rewrite the foreach block, but that's not the point.
foreach was just an example.
Thanks in advance,
int a[1000];
int* b=&a[100]; // or a+100
b[0]=0;
what I would like to do is create a new int[] array object and have it
point at the beginning of the 100th element of array "a" and set its
size to 100 elements, so I can pass that reference array to another
function that does a foreach loop. I only want to perform operations on
those 100 elements, not the whole array.
// Yes, I can rewrite the foreach block, but that's not the point.
foreach was just an example.
Thanks in advance,