【发布时间】:2011-07-06 10:57:13
【问题描述】:
我有以下不允许的代码(以下错误),为什么?
struct A
{
private int b;
public A(int x)
{
B = x;
}
public int B
{
get { return b; }
set { b=value; }
}
}
我收到以下错误:
“this”对象在其所有字段都被分配之前不能使用 必须在返回控制之前完全分配到字段“Test.x” 给来电者
【问题讨论】:
-
检查我的回答你会清楚地了解它
标签: c# properties struct