2015-04-25 39 views
2
#include <iostream> 
using namespace std; 

int main(int argc, char** argv) { 

    cout << "Whatever"; 

    return 0; 
} 

enter image description here为什么cout在代码块中没有输出?

COUT不工作,也不printf的,也没有放,也没有什么。另外,我已经检查了项目属性,并且调试和发布都设置为“控制台应用程序”并且“最终暂停”。这个不成立。

编辑:另外,我试过在使用endl之前刷新(没有结果)。

+0

变化'的cout <<“不管” ;'''cout <<“无论”<< endl;' –

+0

尝试打印一个结束语。我想我曾经有过这个问题。 – Atuos

+0

仍然无法正常工作(我试过冲洗过)。 –

回答

4

我写的回应我的评论: 您的图片显示选项“-mwindows”,即去除控制台,如在http://www.mingw.org/wiki/FAQ(MinGW的常见问题解答)说

How do I remove DOS command windows? 
    In the link step add a "-mwindows" switch to the command line. 
+0

它没有工作,但我解决了它。我不得不在Code Blocks上创建另一个项目(出于某种原因,这个项目太疯狂了,但是我给你的答案是正确的,因为我不知道这实际上是删除了DOS命令。 –