Eclipse CDT Debug console not displaying program output

时间秒杀一切 提交于 2019-12-06 03:04:19

问题


I am using Eclipse IDE for C/C++ Developers (Eclipse Ganymede Package - version 3.4.2) on Windows XP with MinGW GCC 4.2.1 and GDB 6.8-3.

I am facing a problem very similar to that mentioned here. A simple hello world program will not print to the console output in the debugger. A run command displays the output correctly. I have checked both gdb output console and the output console.

What are the right settings to get the output in console window of eclipse?


回答1:


//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;
}


来源:https://stackoverflow.com/questions/888241/eclipse-cdt-debug-console-not-displaying-program-output

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