in reply to Re: The delay of printing encountered using loop
in thread The delay of printing encountered using loop
#include <stdio.h> /* #include <unistd.h> */ main(){ while(1){ sleep(1); printf("123"); } return 0; }
The above code, when running on Windows Turbo C, it prints 123 every second without the necessity of a NL character. But when compiled on g++ on Unix, it never prints anything because of no NL for the stream to be flushed.
But ActicePerl on Windows has the same behavior as on Unix, i.e. it prints nothing without seeing an NL character.
Is this because Perl tries hard to make itself platform independent, or it's because that Turbo C is archaic and has such different behavior than every one else?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: The delay of printing encountered using loop
by Anonymous Monk on Jun 26, 2012 at 21:24 UTC | |
by Diamondust (Novice) on Jun 27, 2012 at 11:26 UTC |