Difference between revisions of "Csharp warning CS0168: The variable 'NeverUsed' is declared but never used"

esse quam videri
Jump to: navigation, search
m (Text replacement - "<csharp>" to "<syntaxhighlight lang="csharp" line="1" >")
m (Text replacement - "</csharp>" to "</syntaxhighlight>")
Line 12: Line 12:
 
         }
 
         }
 
     }
 
     }
}</csharp>
+
}</syntaxhighlight>
 
Produces
 
Produces
  

Revision as of 18:29, 25 January 2016

 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.