Welcome to Web-News
A Web-based News Reader
Subject Re: writef
From Claus D. Volko <cdvolko@gmx.net>
Date Wed, 14 Jan 2009 11:52:09 -0500
Newsgroups digitalmars.D

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.
>


Recent messages in this thread
 
-# Re: writef Claus D. Volko 13-Jan-2009 12:56 pm
.|# Re: writef Steven Schveighoffer 13-Jan-2009 01:49 pm
.\# Re: writef (Current message) Claus D. Volko 14-Jan-2009 11:52 am