Write your question here.i WROTE "MYFIRST PROGRAM" IN visual studio community 2017 version. I have to add #include "stdafx.h". second after I run debugger. Why dos "monitor black screen" did not stay on?
Because the program finished. It opens a console, executes, and once complete, the console closes.
You have 2 options. Option 1 is to open a console manually and use dos commands to run your program. Start - run - cmd will open it, but you will have to learn dos on your own (its like 5 commands you may need, cd being the first critical one).
Option 2 is to insert something in your program to prevent it from ending until you want it to, like reading a variable with cin or using system("pause") before the end of main.