Why my console is so quickly close so I can't see my code | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Why my console is so quickly close so I can't see my code

So after I write console.writeline, and execute the program the console(cmd) are quickly close so I can't see my code is working or not. anyone have the answers?

15th Feb 2017, 11:19 AM
Khrisnanda
2 ответов
+ 3
It closes because it is finished. You can add Console.Readline() or Console.Read() or Console.ReadKey() method before return or if youre using VisualStudio you can execute your code with ctrl+f5.
15th Feb 2017, 11:23 AM
Roman Santa
Roman Santa - avatar
0
I'm not using any IDE ( Stupid me ) I'm typing the code with notepad. Then compiled it with the batch file. csc HelloWorld.cs HelloWorld.exe pause
15th Feb 2017, 1:25 PM
K.C. Leung
K.C. Leung - avatar