INFO: fstream's File Pointers Are Not Independent (104634)
The information in this article applies to:
- Microsoft C/C++ for MS-DOS 7.0
- Microsoft C/C++ for MS-DOS 7.0a
- 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 Q104634 SUMMARY
The Microsoft "iostream Class Library Reference" in the Books Online
included with Visual C++ 32-bit Edition, version 4.0, contains the
following as part of the description for class filebuf:public iostream:
The reserve area, put area, and get area are introduced in the
streambuf class description. The put area and the get area are
always the same for filebuf objects. Also, the get pointer and
put pointers are tied; when one moves, so does the other.
Previous versions of the Microsoft "iostream Class Library Reference" for
class filebuf:public iostream state the following:
Although the filebuf object's get and put pointers are
theoretically independent, the get area and the put area cannot
both be active at the same time.
This statement can lead to some confusion as to whether the get and
put pointers are independent of each other. In the Microsoft iostream
library implementation of fstream, these pointers are not independent
of each other. If the get pointer moves, so does the put pointer. The
source code listed below demonstrates this behavior.
Modification Type: | Major | Last Reviewed: | 12/1/2003 |
---|
Keywords: | kbcode kbinfo kbLangCPP KB104634 |
---|
|