Visual Studio doesn't open a DOS window when I

2019-09-21 00:07发布

here is my code.

build succeeded

I have setup everything. When I click Ctrl+F5, it does not show anything. I just want it to show my name with a black window. How do I do that?

2条回答
我只想做你的唯一
2楼-- · 2019-09-21 00:27

Instead of running your program from within the development environment, open a Command Prompt window and navigate to the folder where the .exe is created and run it directly. That's how command-line programs are meant to be run.

If you have to run it in the development environment, perhaps for debugging, then put a breakpoint on the return or exit statement so it stops before the window is closed.

查看更多
啃猪蹄的小仙女
3楼-- · 2019-09-21 00:30

Most likely you have the subsystem set to "Windows application", which means the process will start with no console associated. Attempts to write will then fail.

You can either associate a console with AttachConsole() and/or AllocConsole() or change the subsystem via linker command line (/SUBSYSTEM:CONSOLE).

查看更多
登录 后发表回答