下面的程序在第一次注释的地方当把“f=0”改为"f"时会报错,为什么啊?
using System;
using System.Collections.Generic;
using System.Text;
namespace review004
{
class Program
{
static void Main(string[] args)
{
int a, b, c, d,e,f=0; //??为什么f不初始化就报错??
a = 2;
b = 3;
c = 5;
d = 6;
if ((e = a + b) == 5 && (f = c + d) == 11)
Console.WriteLine("&&全真");
Console.WriteLine("e={0},f={1}",e,f);
if (e == 1 & (f = 100) == 100) //&与&&不同之处:&在任何条件下都执行两边的语句
Console.WriteLine("bugaia");
Console.WriteLine("f={0}",f);
Console.Read();
}
}
}