Dynamic arrays with pointers in C#
Forums:
unsafe {
int* arInt = stackalloc int[10];
//the first element
arInt[0] = 1;
//the second element
*(arInt + 1) = 2;
//the tenth element
arInt += 9;
*arInt = 10;
arInt -= 9;
}
- Log in to post comments