Пример #1
0
        private unsafe void PrintDemo(Demo *pDemo)
        {
            /*
             * The first way to access the properties of the struct is to use the "*" followed by the stuct pointer
             * contained in brackets. Then you simply use dot notation like you would a normal struct. As seen below.
             */
            Console.WriteLine((*pDemo).N + " " + (*pDemo).M);

            /*
             * The second way to access the value is to use the arrow function. As seen below
             */
            Console.WriteLine(pDemo->N + " " + pDemo->M);
        }
Пример #2
0
 //pointers with struct
 static unsafe void PrintDemo(Demo *demo)
 {
     Console.WriteLine((*demo).N + " " + (*demo).M);
     Console.WriteLine(demo->N + " " + demo->M);
 }