问题
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