Xcode不显示控制台输出;您如何刷新控制台? [英] Xcode not showing console output; How do you flush the console?

查看:633
本文介绍了Xcode不显示控制台输出;您如何刷新控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的C ++程序,该程序使用cout和printf来记录内容,并且仅在关闭程序时显示在结尾,但是如果我使用debug单步执行程序,则不会显示任何内容。有人遇到这个问题吗?

I have a simple C++ program that uses cout and printf to log stuff and it is only showing at the end when the program is closed but if I'm stepping through the program using debug nothing is shown. Did anybody have this problem?

推荐答案

如果您正在练习 c ,请尝试 fflush ,如果c ++请尝试 cout<< endl; 每次要打印。

If you're practicing c try fflush, if c++ try cout << endl; each time you want to print.

这篇关于Xcode不显示控制台输出;您如何刷新控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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