-> 运算符将指针取消引用与成员访问组合在一起。
备注
示例
![]() | |
---|---|
// cs_operator_dereferencing.cs // compile with: /unsafe using System; struct Point { public int x, y; } class MainClass { unsafe static void Main() { Point pt = new Point(); Point* pp = &pt; pp->x = 123; pp->y = 456; Console.WriteLine ( "{0} {1}", pt.x, pt.y ); } } |
输出
123 456 |
请参见
