S
sahel
Hi ;
I wrote a program that it has error if u have time plz help me;
It must get 5 char from user (without pressing Enter key)
Than shows each of the char in different line
But it has this error : Error 1 Cannot implicitly convert type
'System.ConsoleKeyInfo' to 'char'
using System;
class Program
{
static void Main(string[] args)
{
ConsoleKeyInfo d;
char [] string1=new char [5];
for (int i = 0; i < 5; i++)
{
d= Console.ReadKey(false);
string1=d;
}
for (int i = 0; i < 5; i++)
{
Console.WriteLine(string1);
}
}
}
I wrote a program that it has error if u have time plz help me;
It must get 5 char from user (without pressing Enter key)
Than shows each of the char in different line
But it has this error : Error 1 Cannot implicitly convert type
'System.ConsoleKeyInfo' to 'char'
using System;
class Program
{
static void Main(string[] args)
{
ConsoleKeyInfo d;
char [] string1=new char [5];
for (int i = 0; i < 5; i++)
{
d= Console.ReadKey(false);
string1=d;
}
for (int i = 0; i < 5; i++)
{
Console.WriteLine(string1);
}
}
}