Xcode std::cout output acting odd

非 Y 不嫁゛ 提交于 2019-12-12 04:34:33

问题


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?

Any help would be greatly appreciated.


回答1:


Guess 8.3.2 is the answer! This update just popped up on my comp:



来源:https://stackoverflow.com/questions/43484206/xcode-stdcout-output-acting-odd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!