INFO: Output Stream cout Is BufferedLast reviewed: October 7, 1997Article ID: Q94227 |
The information in this article applies to:
SUMMARYIn an application developed with Microsoft C/C++, the cout stream is buffered. In other words, information sent to the cout stream does not appear on the screen until its buffers are flushed. For Visual C++ versions 4.2 and 5.0, this behavior only occurs when using the old iostream libraries. There are four methods to flush the cout buffer, as follows:
MORE INFORMATIONBecause cout is buffered, text that the application creates is not immediately displayed on the screen. In some circumstances, this behavior might be misinterpreted as an error in cout. For an example of an application that determines when to flush the cout buffer, see pages 377- 378 of the Microsoft C/C++ "Class Libraries User's Guide" for version 7.0. For more information on flushing the cout stream with the endl manipulator, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q83081 TITLE : INFO: Endl Flushes the cout Buffer Immediately Upon Execution Keywords : CPPLngIss Version : MS-DOS:7.0; WINDOWS:1.0,1.5,1.51,1.52; WINDOWS NT:1.0,2.0,2.1,4.0,5.0; Platform : MS-DOS NT WINDOWS Issue type : kbinfo |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |