0
How Can I Accept an input Character?
5 Antworten
+ 1
All inputs strings so you'll need to access the character value like this:
string x = Console.readline();
char y = x[0];
+ 1
I tried to input multiple characters and I didn't received an error :) I guess the difference in ReadLine() and Read() is demonstrated in this problem.
+ 1
i found a solution sir,
say for example:
char let;
let = (char) Console.Read();
I have used this code for my Customized Pyramid Program :)
0
Hmm try typing more than one character and tell me if you get an error
0
If you specifically want a character as input then try ReadKey(). It only takes one key press as it's input, dont even need to press enter after pressing the key haha.