RE: Re[2]: [Dev-C++] Cleaning the Input Buffer
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <iv...@em...> - 2003-06-09 11:40:21
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Krzysztof Kapuscik
> Sent: Monday, June 09, 2003 2:10 PM
> To: dev...@li...
> Subject: Re[2]: [Dev-C++] Cleaning the Input Buffer
>
>
> IV> In the contrary they are simpler, they should not be
> slower and make the
> IV> program with less lines and more bullet-proof.
>
> Yes, for sure... And also some problems could happen when mixing stdio
> and iostream code because of separated buffering, for example:
>
> printf (" Something")
> cout << " strange";
> printf (" happened"); <= here stdout is flushed
> cout << " with the string";
>
> could produce:
>
> Something happened strange with the string
>
> I don't know if it is regulated by C++ standard, but some compilers
> make code with "special effects" described above...
The C subset I/O functions use their own buffers (for caching), so printf()
has its own cache buffer while cout has its own.
Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
|