如何在C暂停? [英] How to pause in C?

查看:134
本文介绍了如何在C暂停?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是C的初学者我运行C程序,但窗口关闭太快之前,我可以看到什么。我怎样才能暂停窗口?

I am a beginner of C. I run the C program, but the window closes too fast before I can see anything. How can I pause the window?

推荐答案

您可以把

getchar();

在主函数的返回之前。将等待一个字符输入退出程序之前。

before the return from the main function. That will wait for a character input before exiting the program.

另外,您可以通过命令行运行您的程序和产量将是可见的。

Alternatively you could run your program from a command line and the output would be visible.

这篇关于如何在C暂停?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆