Variable is assigned but its value is never used (C#)
In Visual Studio I used the following code: private bool answer = true; Private Buttonclick() { if() { answer =false } } Compiler gives me a warning that says "answer is assigned but its value is never used". How do I fix this? It means you have given answer a value, but not referenced it elsewhere. Meaning you are not using answer elsewhere in your program. You fix it by referencing answer from another part of your program. If you want to disable warnings, the error list contains a button that can stop them being shown in the list. Additionally, a warning is just a warning. They won't stop