c++ read file

include

include

include

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;
}

你可能感兴趣的:(c++ read file)