How to read char from the console
Use Console.ReadKey
and then KeyChar
to get char
, because ConsoleKeyInfo
is not assignable to char
as your error says.
input[i] = Console.ReadKey().KeyChar;
Use Console.ReadKey
and then KeyChar
to get char
, because ConsoleKeyInfo
is not assignable to char
as your error says.
input[i] = Console.ReadKey().KeyChar;