Lỗi tại dòng ifstream fi(path) .
Tại sao em phải dùng 1 xâu kí tự thay vì 1 biến kiểu string ạ?
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
using namespace std;
int main()
{
string path;
cout <<"File's path: ";
cin >>path;
ifstream fi(path);
if (fi.is_open())
{
while (!fi.eof())
{
string line;
getline(fi,line);
cout <<line <<endl;
}
}
else cout <<"File is not found!" <<endl;
fi.close();
system("pause");
return 0;
}

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?