[C++-sig] Stdout from c++
s_sourceforge at nedprod.com
Thu Nov 6 01:28:15 CET 2003
On 5 Nov 2003 at 10:42, Stefan Seefeld wrote:
> short answer: get a better OS.
Actually the NT core, assuming he's running that, is as good as any
Unix in this department. In fact, I'd go so far as to say NT core is
Unix++ design-wise - it certainly smells of Unix and it's superior to
POSIX in many areas.
> long answer: if the OS has the concept of an output stream, and its
> (buggy) std::cout implementation doesn't connect to it,
> write your own streambuf that writes to this output
> stream, then redirect std::cout to use your streambuf.
NT uses the concept of multiple consoles attached to a process. If
you link using /SUBSYSTEM:CONSOLE, linked in CRT code creates a
console for you, attachs stdin/stdout/stderr of the CRT library to it
and opens it.
IDLE should redirect stdin/stdout/stderr to its own window. Therefore
printf() should work fine. My code uses printf and it all appears in
the IDLE window perfectly. Hence I really don't see why cout isn't
working as intended I'm afraid. I'm running Win2k and Win9x may vary
significantly in this area. However, if you're developing on Win9x,
then you're mad plain and simple ;)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 208 bytes
Desc: not available
More information about the Cplusplus-sig