Visual Studio 2017 Code Output Not Showing

2019-08-31 02:28发布

I'm using Visual Studio 2017 Community and I've faced the problem of the output of my code not displaying.

Before, when I run C code (usually with Ctrl+F5), the output would be displayed on the output window, but for some reason now when I do it there is no output (a command prompt-like window literally blinks and disappears).

I haven't changed anything and I'm really confused as to why this error is occurring. Does anybody have any ideas why?

Here's the screen after writing a simple "Hello World" program and pressing Ctrl+F5.

enter image description here

My code output would normally appear in the console box on the bottom, but now it just shows the build results.

When I create a new project, I click on Empty Project, then add an item and save it as a .c source code. I've been using the same method but have suddenly encountered a problem.

Thank you.

2条回答
时光不老,我们不散
2楼-- · 2019-08-31 03:00

For Windows only:

#include <stdlib.h>

put system("Pause") right at the end.

for cross-platform stuff use

getchar();

instead of system("Pause");

查看更多
戒情不戒烟
3楼-- · 2019-08-31 03:02

Sorry for the inconvenience everybody, but I've found the issue. Apparently Visual Studio 2017 has some new modifications from previous versions that I have been using.

Anybody who faces the same issue as I have may refer to the following video link that I used:

https://www.youtube.com/watch?v=Slgwyta-JkA

查看更多
登录 后发表回答