为什么cout在代码块上没有任何输出? [英] Why cout is producing no output on Code Blocks?

查看:175
本文介绍了为什么cout在代码块上没有任何输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include <iostream>
using namespace std;

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

    cout << "Whatever";

    return 0;
}

Cout不起作用,printf,puts也不起作用。另外,我检查了项目属性,并将调试和发行版设置为控制台应用程序和最后暂停。

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.

编辑:此外,我也尝试过使用endl刷新(无结果)。

Also, I've tried to flush with endl before (No results).

推荐答案

我正在写评论作为回应:
您的图像显示选项 -mwindows,它删除了控制台,如 http://www.mingw.org/wiki/FAQ (MinGW常见问题解答)

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.

这篇关于为什么cout在代码块上没有任何输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆