6

我在带有MinGW GCC 4.2.1GDB 6.8-3的 Windows XP 上为 C/C++ 开发人员使用 Eclipse IDE(Eclipse Ganymede 包 - 版本 3.4.2)

我面临的问题与此处提到的问题非常相似。一个简单的 hello world 程序不会打印到调试器中的控制台输出。运行命令正确显示输出。我已经检查了 gdb 输出控制台和输出控制台。

在 Eclipse 的控制台窗口中获取输出的正确设置是什么?

4

1 回答 1

2

//have you put endl at the end of your output?

int main()
{
    cout << "!!!Hello World!!!"; // prints nothing to console ; no endl
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! twice
    return 0;
}
于 2009-09-20T07:55:57.120 回答