NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

-> Operator

The -> operator combines pointer dereferencing and member access.

An expression of the form

x->y

(where x is a pointer of type T* and y is a member of T) is equivalent to

(*x).y

The -> operator can be used only in unsafe code.

The -> operator cannot be overloaded.

Example

using System;
struct Point { public int x, y; }
class Test {
   public static void Main() {
      Point pt = new Point();
      unsafe {
         Point* pp = &pt;
         pp->x = 123;
         pp->y = 456;
      }
      Console.WriteLine ( "{0} {1}", pt.x, pt.y );
   }
}

Output

123 456

See Also

C# Operators