在我们的一个项目中,我们有与以下类似的代码。谁能解释(用简单的英语)为什么这里需要固定语句?
class TestClass
{
int iMyVariable;
static void Main()
{
TestClass oTestClass = new TestClass();
unsafe
{
fixed (int* p = &oTestClasst.iMyVariable)
{
*p = 9;
}
}
}
}