日期:2014-05-17 浏览次数:20795 次
char p1 = '1';
int t = 1;
char p2 = Convert.ToChar(t);
Console.WriteLine(p1 == p2);
char p2 = Convert.ToChar(t);与下一语句等效
char p2 = (char)1;
char p2 = Convert.ToChar(t.ToString());后ASCII码值为49
using System;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
char p1 = '1';
char p2 = Convert.ToChar(1);
Console.WriteLine(p1);
Console.WriteLine(p2);
Console.ReadLine();
}
}
}