我能想到几种快速读取最后 128 位的方法,但哪种方法最简单、最有效?
最佳答案
跳到最后阅读:
char buf[16];
std::ifstream infile("thefile.bin", std::ios::binary);
infile.seekg(16, std::ios::end);
if (!infile || !infile.read(buf, 16))
{
// error! Maybe die.
}
// process buf
关于c++ - 在 C++ 中从文件末尾读取最有效的方法是什么? (解析文件中的最后 128 位),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9648457/