Linux vs. libio
Per Bothner
per@bothner.com
Mon Dec 20 20:47:00 GMT 1999
Joe Buck <jbuck@synopsys.COM> writes:
> main ()
> {
> printf ("This should be line 1.\n");
> cout << "This should be line 2.\n";
> }
>
> might not work as expected, because stdout and cout will not be
> synchronized. But most things will work just fine. It would be much
> the same as the situation on an OS with a proprietary libc: the
> C++ and C i/o code would be separate.
This is required to work according to the C++ standard, so it better
work on an OS with a proprietary libc. However, it will work much less
efficiently.
What will stop working is:
fprintf((FILE*) cout.rdbuf(), "This should be line 1.\n");
I certainly don't see many programs breaking because of this ...
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/
More information about the Libc-alpha
mailing list