The C# compiler rejects the use of an un-assigned int. However using an int via a class is not forbidden. Why that difference? And why not allow the use of un-initialized variables as they are guaranteed to be zero?
class Program
{
class MyInt { public int I; }
static void Main(string[] args)
{
MyInt mi = new MyInt();
Console.WriteLine(mi.I);// accepted by the compiler
int i;
Console.WriteLine(i); // rejected by the compiler
}
}