朱色虫居
Pages
Home
Featured Posts
2007/03/11
C++:讀檔到標準輸出
讀檔到標準輸出
分類:C/C++
#include
#include
#include
#include
using namespace std;
int main()
{
string file_name;
cout << "input filename:"; cin >> file_name;
ifstream infile(file_name.c_str());
istream_iterator ins(infile), eos;
ostream_iterator outs(cout, " ");
copy(ins,eos,outs);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment