问题
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?
回答1:
If you're practicing c try fflush
, if c++ try cout << endl;
each time you want to print.
来源:https://stackoverflow.com/questions/3316195/xcode-not-showing-console-output-how-do-you-flush-the-console