Namespaces
Variants

std:: streamoff

From cppreference.net
< cpp ‎ | io
定义于头文件 <ios>
typedef /*由实现定义*/ streamoff ;

类型 std::streamoff 是一种实现定义的 有符号整数类型 (since C++11) ,其大小足以表示操作系统支持的最大可能文件尺寸。 通常,它是 long long 的别名。 (since C++11)

它用于表示流位置的偏移量(类型为 std::fpos 的值)。由 - 1 构造的 std::streamoff 值也被某些 I/O 库函数用于表示错误状态。

与 std::fpos 的关系

  • 两个 std::fpos 对象之间的差值是一个类型为 std::streamoff 的值
  • 类型为 std::fpos 的值可隐式转换为 std::streamoff (转换结果为距文件起始位置的偏移量)。
  • 类型为 std::fpos 的值可从类型为 std::streamoff 的值构造

参阅

表示流或文件中的绝对位置
(类模板)
设置输入位置指示器
( std::basic_istream<CharT,Traits> 的公开成员函数)
设置输出位置指示器
( std::basic_ostream<CharT,Traits> 的公开成员函数)