I would like to know if file redirection can also be used compilers
installed in Win32...like the one I have called vide. the file redirection I am talking about is of this type...
< $proramName> file1.txt > file2.txt
if it is possible implementing with Win32 can anyone suggest
how I can implement the above operation currently I have program that uses command line arguments that I run this
and it outputs on the screen but I would like to redirect the output to another file.
thanks in advance.
this is just thebegining of the of my program.
int main(int argc, char* argv)
if (argc != 2)
cerr<<"\n no file name specified " <<endl;
infile.open( argv );
if ( !infile )
cerr<<"\n can't open " << argv <<endl ;
If you want to do what I think you are talking about, you will need to change cerr to cout and then it should work. cerr is the output error stream and is non-redirectable, cout however will allow the output to be redirected to a file like you are attempting.