If the operation sets an internal state flag that was registered with member exceptions, the function throws an exception of member type failure. Multiple flags may be set by a single operation. When set, the integrity of the stream may have been affected. The function stopped extracting characters because the input sequence has no more characters available ( end-of-file reached).Įither the function could not extract n characters or the construction of sentry failed.Įrror on stream (such as when this function catches an exception thrown by an internal operation). Parameters s Pointer to an array where the extracted characters are stored.Įrrors are signaled by modifying the internal state flags: The number of characters successfully read and stored by this function can be accessed by calling member gcount. Then (if good), it extracts characters from its associated stream buffer object as if calling its member functions sbumpc or sgetc, and finally destroys the sentry object before returning. Internally, the function accesses the input sequence by first constructing a sentry object (with noskipws set to true). If the input sequence runs out of characters to extract (i.e., the end-of-file is reached) before n characters have been successfully read, the array pointed to by s contains all the characters read until that point, and both the eofbit and failbit flags are set for the stream. This function simply copies a block of data, without checking its contents nor appending a null character at the end. Extracts n characters from the stream and stores them in the array pointed to by s.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |