嗨,看看下面的代码
为什么Convert.ToInt32()的行为在2的情况不同。char c = 'a';
a=Convert.ToInt32(c);
Console.WriteLine("hi" + a);//displays output:- Hi97
a=Convert.ToInt32(Console.ReadLine());//Gives complie time error(throws an exception) if I enter 'a'(a only without quotes) on screen.