digitalmars.D - Bug or just ugly behavior?
- Tomás Rossi (16/16) Nov 13 2005 Code:
- Unknown W. Brackets (8/29) Nov 13 2005 I'm pretty sure, even with cout and friends in C++, you have to flush
- Tomás Rossi (5/32) Nov 14 2005 Ok, I suspect this was the case. Though I think I've done this with C (d...
-
Stewart Gordon
(12/17)
Nov 15 2005
- Unknown W. Brackets (4/18) Nov 17 2005 *smacks his head*...
Code: Compiled with dmd 0.139 win32, executed it outputs: Some text Press any key to continue . . . Another text It's a buffered output normal behavior or something wrong with pause call? Do you guys think this is a bug? Tom
Nov 13 2005
I'm pretty sure, even with cout and friends in C++, you have to flush the stream before you want to run a system call like that. On a tangent, that's horribly inefficient. I'm sure there is (or should be) a function to wait for input, and if there is not, piping it ain't the way, is it? Anyway, try adding a fflush in there before the pause, e.g.: fflush(stdio); -[Unknown]Code: Compiled with dmd 0.139 win32, executed it outputs: Some text Press any key to continue . . . Another text It's a buffered output normal behavior or something wrong with pause call? Do you guys think this is a bug? Tom
Nov 13 2005
In article <dl98hd$2rf$1 digitaldaemon.com>, Unknown W. Brackets says...I'm pretty sure, even with cout and friends in C++, you have to flush the stream before you want to run a system call like that. On a tangent, that's horribly inefficient. I'm sure there is (or should be) a function to wait for input, and if there is not, piping it ain't the way, is it? Anyway, try adding a fflush in there before the pause, e.g.: fflush(stdio); -[Unknown]Ok, I suspect this was the case. Though I think I've done this with C (don't know if printf in C behave like this) and C++ and despite of buffers I could never note such an excesive buffering result. I'll keep moving, Thanks.TomCode: Compiled with dmd 0.139 win32, executed it outputs: Some text Press any key to continue . . . Another text It's a buffered output normal behavior or something wrong with pause call? Do you guys think this is a bug?
Nov 14 2005
Unknown W. Brackets wrote:I'm pretty sure, even with cout and friends in C++, you have to flush the stream before you want to run a system call like that. On a tangent, that's horribly inefficient. I'm sure there is (or should be) a function to wait for input,<snip> std.c.stdio.getch() Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Nov 15 2005
*smacks his head*... Yes, yes, that's the one. I've not done enough console programming of late :$. -[Unknown]Unknown W. Brackets wrote:I'm pretty sure, even with cout and friends in C++, you have to flush the stream before you want to run a system call like that. On a tangent, that's horribly inefficient. I'm sure there is (or should be) a function to wait for input,<snip> std.c.stdio.getch() Stewart.
Nov 17 2005