Why cout is producing no output on Code Blocks?

﹥>﹥吖頭↗ 提交于 2019-12-11 04:01:47

问题


#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

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