Do i need to write Console.ReadKey() in new versions C#? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Do i need to write Console.ReadKey() in new versions C#?

13th Mar 2021, 1:30 PM
Viamos
Viamos - avatar
5 Answers
+ 1
I use this to prevent the program from closing immediately. For example, when I want to display text on the screen. I saw this in YouTube tutorials
13th Mar 2021, 5:09 PM
Viamos
Viamos - avatar
+ 1
http://csharp.net-informations.com/overview/csharp-console-application.htm#:~:text=How%20to%20stop%20C%23%20console,lose%20Visual%20Studio's%20debug%20information. You can use console.readkey for this. But also ctrl-F5
13th Mar 2021, 6:55 PM
sneeze
sneeze - avatar
+ 1
Thanks 👍
14th Mar 2021, 3:48 AM
Viamos
Viamos - avatar
0
You can still use it, but it is not mandatory. When do you use it ?
13th Mar 2021, 5:05 PM
sneeze
sneeze - avatar
0
Yes, Using this will not terminate the console immediately. You can use it in new version too.
15th Mar 2021, 4:59 AM
Illa Bahadur Darlami Magar
Illa Bahadur Darlami Magar - avatar