static int Main(string[] args) { IntPtr p = IntPtr.Zero; unsafe { FooStruct *s = (FooStruct *)(p); } return(0); }
public unsafe static int test_0_ldelema_ptr() { int i; int len = 10; FooStruct *[] ptr_array = new FooStruct * [len]; FooStruct str = new FooStruct(3); for (i = 0; i < len; i++) { WritePtr(&str, out ptr_array [i]); } for (i = 0; i < len; i++) { if (ptr_array [i]->i != 3) { return(i); } } return(0); }
private unsafe static void WritePtr(FooStruct *val, out FooStruct *ptr) { ptr = val; }