While coding i got a warning saying that “The variable 'i' is assigned but its value is never used”. This warning basically appear because the given variable is not in use.
If you compile the below code it will give above warning.
using System;
namespace MyApp
{
class _class
{
public static void Main(string[] args)
{
int i = 0;
Console.Read();
}
}
}
How fix above warning :
To fix above warning just use the unused variable anywhere in the code.
using System;
namespace MyApp
{
class _class
{
public static void Main(string[] args)
{
int i = 0;
Console.WriteLine(i);
Console.Read();
}
}
}
you can change the Warning level on the Build tab of the Project's properties.
ReplyDelete