By opening STDOUT in that manner, you have told it to direct output to that file, output_cal_date.txt, but only while it is open. Close it only after you have printed what you want to print.
In reply to Re: Take the input from command line and have output redirected to a file?
by GotToBTru
in thread Take the input from command line and have output redirected to a file?
by G Nagasri Varma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |