64,643
社区成员
发帖
与我相关
我的任务
分享
#include"stdafx.h"
#include<fstream>
#include<string>
#include<iostream>
using namespace std;
int main(int argc,char *argv[])
{
cout<<argv[1]<<endl;
string str;
fstream file;
file.open(argv[1]);
if (file.is_open())
{
while(!file.eof())
{
getline(file,str);
cout<<str;
}
}
else cout<<"open file error!"<<endl;
return 0;
}