INFO: Endl Flushes the cout Buffer Immediately Upon Execution (83081)
The information in this article applies to:
- Microsoft Visual C++ 1.0
- Microsoft Visual C++ 1.5
- Microsoft Visual C++ 1.51
- Microsoft Visual C++ 1.52
- Microsoft Visual C++ 2.0
- Microsoft Visual C++ 2.1
- Microsoft Visual C++ 4.0
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q83081 SUMMARY
In these products, the cout class uses a buffering system for data that may
not be flushed immediately. Because cout usually handles small messages,
several messages are usually needed to fill the buffer, which will cause
the data to be written to the standard output handle. In some cases, this
can cause considerable delay when writing output to the screen during a
debugging session. This problem can be avoided, however, by using the endl
manipulator. When appended to the end of a cout call, the endl manipulator
inserts a newline character and then flushes the buffer.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbinfo kbLangCPP KB83081 |
---|
|