64,642
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
using namespace std;
int main()
{
string s="123.txt";
vector<string> sv;
string line,filename,word;
ifstream ifile(s.c_str());
if(!ifile)
return -1;
getline(ifile,line);
istringstream istring(line);
istring>>filename;
ifile.close();
ifile.clear();
ifstream ifile1(filename.c_str());
if(!ifile1)
return -1;
system("pause");
return 0;
}
#include <iostream>
#include <fstream>
using namespace std;
int main(){
ifstream in("f:/123.txt");
char buf[128];
in>>buf;
ifstream in2(buf);
in2>>buf;
cout << buf;
in.close(), in2.close();
return 0;
}