Ejemplo n.º 1
0
        static int Main(string[] args)
        {
            IntPtr p = IntPtr.Zero;

            unsafe {
                FooStruct *s = (FooStruct *)(p);
            }

            return(0);
        }
Ejemplo n.º 2
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);
    }
Ejemplo n.º 3
0
 private unsafe static void WritePtr(FooStruct *val, out FooStruct *ptr)
 {
     ptr = val;
 }