我在 SO 中搜索并发现了一些类似的问题,但它们并没有解决我的问题。
我正在使用ASP.Net
,这是我的代码:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
int _new = 0;
// other lines of codes which does not include _new
for (int i = 0; i < _Array.Length; i++)
{
if (_Array[i] == "N" || _Array[i] == "NEW")
{
_new = 1;
}
}
// other lines of codes which does not include _new
}
}
我收到The variable declared but value is never used error
警告
int _new = 0;
为什么我收到这个错误?
因为你没有对变量 _new 做任何处理,你只是给它赋值
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句