fstream

    104热度

    7回答

    以下C++代码使用ifstream的对象读取从文本文件中的整数(其具有每行一个数),直到它碰到EOF。为什么它读取最后一行的整数两次?如何解决这个问题? 代码: #include <iostream> #include <fstream> using namespace std; int main() { ifstream iFile("input.txt"); // inpu