我们在其中一个项目中具有与以下类似的代码。任何人都可以用简单的英语解释为什么这里需要固定陈述吗?C#中的固定语句
class TestClass
{
int iMyVariable;
static void Main()
{
TestClass oTestClass = new TestClass();
unsafe
{
fixed (int* p = &oTestClasst.iMyVariable)
{
*p = 9;
}
}
}
}
我看不到任何指针算术在问题中完成。也许你可以澄清'算术'的含义。没有+ - *也没有/。 – 2015-12-18 20:53:46