Variable is assigned but its value is never used (C#)

后端 未结 4 1585
一整个雨季
一整个雨季 2020-12-07 06:18

In Visual Studio I used the following code:

 private bool answer = true;
    Private Buttonclick()
   {
      if()
       {
        answer =false
        }
          


        
4条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 07:15

    If you want to disable warnings, the error list contains a button that can stop them being shown in the list.

    enter image description here

    Additionally, a warning is just a warning. They won't stop your program from compiling, or even running. They may, however, declare in advance runtime errors and the like, so don't ignore them completely.

提交回复
热议问题