Differences in Iostream implementation

xiaoxiao2021-03-06  40

Starting from Visual C .NET 2003, the old iostream library is removed. The main difference between the standard C libraries and the previous runtime library lies in the iostream library. The specific details of the iostream implementation have been changed. If you want to link standard C libraries, it may be necessary to rewrite the code in the code to use iostream. Any old iostream header included in the code must be removed (fstream.h, omanip.h, os.h, iostream.h, istream.h, ostream.h, stream.h, and strstrea.h), and add one Or multiple new standard C iostream header files (, , , , , , , , , and All header files are not .h extension). The next table describes the behavior of the new standard C iostream library does not do with the old iostream library. In the new standard C iostream library: The Open function does not adopt the third parameter (protection parameters). Unable to create a stream from the file handle. In addition to several exceptions, all names in the new standard C library are in the STD namespace. For more information, see Using the C Liber. Use the ios :: OUT flag separately without opening the OFSTream object. iOS :: OUT flags must be combined in logical OR and another iOS enumeration number; for example, a combination of iOS :: IN or iOS :: App. Because the EOFBIT status is set, IOS :: Good will no longer return a non-zero value after reaching the file. Unless you know that there is currently no set base flag, iOS :: setf (_IFlags) should not be used with IOS :: DEC, IOS :: Oct or ios :: HEX flag value. The formatted input / output function and operator assume that only one base is set. Change iOS_BASE. For example, setf (iOS_BASE :: Oct, iOS_BASE :: Basefield) clears all basis information and sets the base to eight-based. IOS :: unsetf Returns VOID instead of the previous value. If an error occurs, iStream :: GET (Char & _rch) is not assigned to the RCH. ISTREAM :: GET (int _ncount, char _delim) is three points: set Failbit when not read any content. After the extracted characters, one EOS is always stored (independent of the results). The value is -1 _ncount is an error. IStream :: seekg with invalid parameters does not set Failbit. Return Type Street is a class with overloaded operators. In returning streampos values ​​(such as iStream :: Tellg, Ostream :: Tellp, strstreambuf :: Seekoff, and strstreambuf :: seekpos), the return value should be converted into the desired type: streamoff, fpos_t, or mbState_t. The first function parameters in strStreambuf :: strStreamBuf (_falloc, _ffree) are used with size_t parameters instead of long.

转载请注明原文地址:https://www.9cbs.com/read-75260.html

New Post(0)