110,545
社区成员
发帖
与我相关
我的任务
分享
例子1:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
int c;
int k = 9;
if (true) {
z(out c);
}
Response.Write(c.ToString());
}
}
public bool z(out int a) {
a = 1;
return true;
}
正常输出1.
例子2:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
int c;
int k = 9;
if (k==9) {
z(out c);
}
Response.Write(c.ToString());
}
}
public bool z(out int a) {
a = 1;
return true;
}
编译错误,c未初始化