原始碼是C++的檔案讀取
#include<iostream>
#include<vector>
#include<string>
#include<fstream>
#include<sstream>
#include<algorithm>
#undef _unicode
using namespace std;
int main() {
ifstream infile;
int num[100];
int i;
infile.open("?C:\\Users\\jyz_1\\Desktop\\Numbers.txt",ios::in);
if (!(infile.is_open)) {
cout << "fail to open the file!" << endl;
}
while (!infile.eof()) {
infile.getline(num, 100, '\n');
}
infile.close();
}
報錯在infile.getline那一行
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/208791.html
標籤:C++ 語言
