I/O manipulators | ||||
Print functions(C++23) | ||||
C-style I/O | ||||
Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
Streams | ||||
Abstractions | ||||
File I/O | ||||
String I/O | ||||
Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
Synchronized Output | ||||
(C++20) | ||||
Types | ||||
streamsize | ||||
Error category interface | ||||
(C++11) | ||||
(C++11) |
Defined in header <ios> | ||
typedef/*implementation-defined*/ streamsize; | ||
The typestd::streamsize
is a signed integral type used to represent the number of characters transferred in an I/O operation or the size of an I/O buffer. It is used as a signed counterpart ofstd::size_t, similar to the POSIX typessize_t
.
Except in the constructors ofstd::strstreambuf, negative values ofstd::streamsize
are never used.
#include <iostream>#include <type_traits> static_assert(std::is_signed_v<std::streamsize>); int main(){std::cout<< sizeof(std::streamsize)<<'\n';}
Possible output:
8
returns number of characters extracted by last unformatted input operation (public member function of std::basic_istream<CharT,Traits> )[edit] | |
extracts and discards characters until the given character is found (public member function of std::basic_istream<CharT,Traits> )[edit] | |
extracts blocks of characters (public member function of std::basic_istream<CharT,Traits> )[edit] | |
inserts blocks of characters (public member function of std::basic_ostream<CharT,Traits> )[edit] |