问题
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
cout << "Whatever";
return 0;
}
Cout does not work, nor printf, nor puts, nor anything. Also, I've checked the project properties and both the debug and release are set to "Console Application" and to "Pause in the end". It makes no sense.
Edit: Also, I've tried to flush with endl before (No results).
回答1:
I am writing my comment as a response: Your image shows option "-mwindows", that removes the console, as said at http://www.mingw.org/wiki/FAQ (MinGW FAQs)
How do I remove DOS command windows?
In the link step add a "-mwindows" switch to the command line.
来源:https://stackoverflow.com/questions/29862154/why-cout-is-producing-no-output-on-code-blocks