Where to use read (),readline () and readkey ()??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Where to use read (),readline () and readkey ()???

18th Jun 2017, 3:18 PM
Aditya Sahu
Aditya Sahu - avatar
2 Answers
+ 1
read() returns a integer value of the first character do not use it anymore, readline is a beter option https://msdn.microsoft.com/en-us/library/system.console.read(v=vs.110).aspx readline returns a string https://www.dotnetperls.com/console-readline readkey returns a ConsoleKeyInfo. This datatype gives a lot of information of the key(s) that was pressed. It is easy to test which key it was for example if (info.Key == ConsoleKey.Escape) https://www.dotnetperls.com/console-readkey readkey does not work in the playground, so you have to test it in your own enviroment https://code.sololearn.com/c9VAXYW9kMsD
22nd Jun 2017, 7:44 PM
sneeze
sneeze - avatar
0
I don't understand the question, isn't it obvious?
18th Jun 2017, 6:46 PM
MayDead2Much
MayDead2Much - avatar