Processing files larger than 2 GB in C++ with STL

本小妞迷上赌 提交于 2019-12-05 04:45:37
Cristian Adam

Not all compilers have STL implementations with large file support.

For example, the following program:

#include <fstream>
#include <iostream>
#include <limits>

int main()
{
    using namespace std;

    cout << numeric_limits<streamoff>::max() << endl;
}

results in:

  • VS2005 - 2147483647
  • VS2008 - 2147483647
  • VS2010 - 9223372036854775807
  • MinGW GCC 4.4.0 - 9223372036854775807

On the other hand STLPort has cross platform large file support.

You should probably use std::fpos_t typedef.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!