Re: Mixed C/C++ bug - g++-3.2_3.2.1-0pre4 (unstable)
* mercoledi` 23 ottobre 2002, alle 19:28, Levi Bard scrive:
> On Wed, 23 Oct 2002 16:53:58 -0500 (CDT)
> John Dahlstrom <jodaman@cegt201.bradley.edu> wrote:
>> While 3.2.1-0pre3 works fine, 3.2.1-0pre4 fails.
>> Given input file test.cpp:
>> #include <stdio.h>
>> #include <iostream>
>> using std::cerr;
>> using std::endl;
>> int main()
>> {
>> fprintf(stderr, "test\n");
>> fflush( stderr );
>> cerr << "test" << endl;
>> }
> In C++, you should include <cstdio> rather than <stdio.h>. Additionally,
> mixing of stdio and iostream is not recommended, especially if you're going
> to use them both on the same stream.
This is not true if you call sync_whit_stdio() on the stream before any
operation on it.
Please wrap your line.
Reply to: