在C#中将char隐式转换为int
问题描述:
我对隐式类型转换有疑问
I have a question about the implicit type conversion
为什么这种隐式类型转换在C#中起作用?我知道隐式代码通常不起作用。
Why does this implicit type conversion work in C#? I've learned that implicit code usually don't work.
我这里有一个有关隐式类型转换的代码示例
I have a code sample here about implicit type conversion
char c = 'a';
int x = c;
int n = 5;
int answer = n * c;
Console.WriteLine(answer);