c++ read file

2021-07-30  本文已影响0人  wasdzy111

include <iostream>

include <fstream>

include <string>

using namespace std;

int main() {
char url[] = "文件路径";
ifstream fin;
fin.open(url);
int count = 0;
string stUin;
while (getline(fin, stUin)) {
count++;
printf("%s\n", stUin.c_str());
}
return 0;
}

上一篇 下一篇

猜你喜欢

热点阅读