[求助]out_put.open(argv[1])是不是有问题?
#include "stdafx.h"
#include "fstream.h"
int main(int argc, char* argv[])
{
ifstream in_put;
ofstream out_put;
char words[100];
cin>>argv[1];
out_put.open(argv[1]); //这里有什么问题???
if (!out_put)
{cout<<"Open fail!"<<endl;
return 1;}
out_put<<"You're right!!"<<endl;
out_put.close();
in_put.open(argv[1]);
if (!in_put)
{cout<<"Open fail!"<<endl;
return 1;}
in_put.getline(words,100);
in_put.close();
cout<<words<<endl;
return 0;
}
[此贴子已经被作者于2007-1-12 19:25:00编辑过]