My program executes with two arguments (put in argv
) like below:
$ myProgram input output
How do I redirect all printf(..)
to the output file? I saw some suggestion about using fflush(stdout)
but I haven't used it before. Could anyone please show me an example?