Xcode std :: cout输出起作用奇数 [英] Xcode std::cout output acting odd
问题描述
我已经使用Xcode两年了,并且已经编写了许多C ++命令行应用程序.在过去的几个月中,我放弃了命令行应用程序,而将精力集中在GUI应用程序上,但是回到一些较旧的命令行应用程序后,我注意到std::cout
的工作方式不符合我上次记得的方式.如果在cin
语句之前有cout
语句,例如"enter age:",则在Xcode中运行应用程序时,它不再首先显示cout语句,而是在cin
的输入之后.我在某处读到输出被缓冲并且需要一个'\ n'来显示文本行,但是据我所知,我以前从未必须这样做. Xcode的较新版本是否有所更改(我保持Xcode完全更新)?我以前能够将项目打印到屏幕上而无需换行.因此,我的旧应用程序无法正常工作.可以在某处进行更改吗?
I've been using Xcode for 2 years and have written quite a few C++ command line applications. For the past few months, I've abandoned command line applications and have focused on GUI applications, but after coming back to some older command line applications, I noticed that std::cout
isn't working the way I last remember. If I have a cout
statement such as "enter age: " before a cin
statement, when running the app in Xcode, it no longer shows the cout statement first, but rather after the input from cin
. I read somewhere that the output was buffered and required an '\n' in order to display the text line, but to my knowledge, I never used to have to do this. Did something change in a newer version of Xcode (I keep Xcode updated entirely)? I use to be able to print items to the screen without needing a newline in order to do it. My old applications are no longer working correctly because of this. Is there a setting somewhere to change it?
任何帮助将不胜感激.
推荐答案
答案8.3.2是答案!此更新刚刚在我的电脑上弹出:
Guess 8.3.2 is the answer! This update just popped up on my comp:
这篇关于Xcode std :: cout输出起作用奇数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!