【发布时间】:2013-11-20 13:24:21
【问题描述】:
我有一个char 数组,我想从控制台分配值。这是我的代码:
char[] input = new char[n];
for (int i = 0; i < input.Length; i++)
{
input[i] = Console.ReadLine();
}
但我收到以下错误:
无法将类型“System.ConsoleKeyInfo”隐式转换为“char”
有没有简单的方法来解决这个问题?
【问题讨论】:
-
你看过
System.ConsoleKeyInfo是什么吗?提示:msdn.microsoft.com/en-us/library/…
标签: c#