Simple D program Output order is wrong

ε祈祈猫儿з 提交于 2020-01-05 22:20:50

问题


I am learning a new language called "D" but i have a problem when trying to write a simple program

import std.stdio;

void main()
{
    double gradeOne;
    writeln("Please enter the First Test Grade: ");
    readf(" s", &gradeOne);


}

Why does my program ask me for the input first before the output message?

I think its just the DDT problem, when i run the program in command prompt its working fine


回答1:


Output to Eclipse buffers output by larger data blocks rather than lines. To force output to appear, insert calls to stdout.flush(); before asking for input to ensure it shows up when you want it.

See also: Eclipse console writes output only after the program has finished



来源:https://stackoverflow.com/questions/19238432/simple-d-program-output-order-is-wrong

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