|
From: Luigi S. <gi...@li...> - 2001-05-19 10:43:43
|
Hi !
Can anybody help me solve this silly problem with C++?
Suppose that I should write a program, named "copy_file", which supports
the following syntax:
command what it does
------------- -----------------------
copy_file copy cin on cout
copy_file input copy the file named "input" on cout
It would be nice to have the work done by these two steps:
- if you find a file name on the command line then attach cin to the file
- copy cin on cout
How do I "reopen" cin? (or, to make it clearer: is there a C++ equivalent
of the C function freopen?)
Any solution will be appreciated.
--
gisan
|