Csharp warning CS0168: The variable 'NeverUsed' is declared but never used

esse quam videri
Revision as of 18:29, 25 January 2016 by Jeff (talk | contribs) (Text replacement - "</csharp>" to "</syntaxhighlight>")
Jump to: navigation, search
 1 using System;
 2 namespace HelloClass
 3 {
 4     class HelloWorld
 5     {
 6         public static void Main()
 7         {
 8                 
 9             int NeverUsed;
10             Console.WriteLine("Hello World!");
11         }
12     }
13 }

Produces

Microsoft (R) Visual C# .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

helloError3.cs(9,17): warning CS0168: The variable 'NeverUsed' is declared but never used

This is only a warning the csc compiler will still compile the program.