更新:2007 年 11 月
错误消息
fixed 语句中声明的局部变量类型必须是指针类型在
下面的示例生成 CS0209:
复制代码 | |
---|---|
// CS0209.cs // compile with: /unsafe class Point { public int x, y; } public class MyClass { unsafe public static void Main() { Point pt = new Point(); fixed (int i) // CS0209 { } // try the following lines instead /* fixed (int* p = &pt.x) { } fixed (int* q = &pt.y) { } */ } } |