Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::streamsize

      From cppreference.com
      <cpp‎ |io
       
       
       
      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.

      [edit]Notes

      Except in the constructors ofstd::strstreambuf, negative values ofstd::streamsize are never used.

      [edit]Example

      Run this code
      #include <iostream>#include <type_traits> static_assert(std::is_signed_v<std::streamsize>); int main(){std::cout<< sizeof(std::streamsize)<<'\n';}

      Possible output:

      8

      [edit]See also

      returns number of characters extracted by last unformatted input operation
      (public member function ofstd::basic_istream<CharT,Traits>)[edit]
      extracts and discards characters until the given character is found
      (public member function ofstd::basic_istream<CharT,Traits>)[edit]
      extracts blocks of characters
      (public member function ofstd::basic_istream<CharT,Traits>)[edit]
      inserts blocks of characters
      (public member function ofstd::basic_ostream<CharT,Traits>)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/streamsize&oldid=176675"

      [8]ページ先頭

      ©2009-2025 Movatter.jp