c++中ifstream一次读取整个文件
读取至char*的情况
std::ifstream t;
int length;
t.open("file.txt"); // open input file
t.seekg(0, std::ios::end); // go to the end
length = t.tellg(); // report location (this is the length)
t.seekg(0, std::ios::beg); // go back to the begi.
转载
2021-09-26 09:38:46 ·
869 阅读 ·
0 评论