From: Greg C. <chi...@co...> - 2006-02-24 15:48:12
|
On 2006-2-24 12:57 UTC, Keith MARSHALL wrote: > Earnie Boyd wrote, quoting me: > >>>Simon wrote: > >>>>Also, when programming for windows, is there a way to output to >>>>the msys shell? >>> >>>What exactly do you mean? >> >>It's probably RXVT. Simon needs to flush the output buffers with >>``_flushall();''. Or, using standard functions (which, unlike _flushall(), flush only the streams and not the OS buffers): /* C */ fflush(0); // C++ std::cout << std::flush; std::cerr << std::flush; std::clog << std::flush; > The alternative is to do as Julien and I do -- rapidly condemn RXVT > to the trash, to get sane behaviour in a native Win32 console :-) I do that too, but alone it's not quite enough. Here's an MSYS-without-rxvt session: $cat hello_world_no_flush.cpp #include <iostream> int main() { std::cout << "Hello, world!"; } $/c/MinGW-20050120/bin/g++ hello_world_no_flush.cpp $./a Hello, world!$ which can be seen as a cockpit error (no newline, no flush), except that it's worse in zsh: msw-native port of zsh-3.0.5: C:/tmp[0]$echo $ZSH_VERSION 3.0.5-nt-beta-0.75 C:/tmp[0]$./a C:/tmp[0]$ cygwin-built zsh-4.2.4: /cygdrive/c/tmp[0]$echo $ZSH_VERSION 4.2.4 /cygdrive/c/tmp[0]$./a /cygdrive/c/tmp[0]$ |