writef

Claus D. Volko cdvolko at gmx.net
Wed Jan 14 08:52:09 PST 2009


Of course the line fflush (stdout); must be written before getch(); - then it works. Great!

Claus D. Volko Wrote:

> Adam D. Ruppe Wrote:
> 
> > On Sun, Jan 11, 2009 at 10:15:45AM -0500, Claus D. Volko wrote:
> > > Thanks for your answer. It sounds plausible to me. Do you know how to manually cause a flush? I've found this code snippet:
> > 
> > fflush(stdout);
> > 
> > That should do it and is imported in std.stdio;
> 
> I've tried it - it doesn't help. :(
> 
> // The "Hello World!" program
> 
> import std.stdio;
> import std.c.stdio;
> 
> void main ()
> {
>   int i;                                    // Variable definition
>   i = 200;                                  // Assignment
>   writefln ("Hello World!");                // Function call
>   writef ("The value of i is ", i, ".");    // Function call
>   getch ();                                 // Function call
>   fflush (stdout);
> }
> 
> I've also tried calling std.stdio.fflush (stdout); to avoid calling the function from std.c.stdio - not the desired effect either.
> 




More information about the Digitalmars-d mailing list