input of a program from file but no output on stdout

Oct 23, 2014 at 12:45pm
I did this


1
2
3
4
5
6
7
8
9
10
    
prog.exe <input.txt> output.txt
//This works fine, that is output goes to the file

prog.exe <input.txt> cout
//OR
prog.exe<input.txt> stdout

//These don't work, that is the program works fine but no output is shown in cmd
  


How do i make sure that output is produced in cmd/stdout?
Last edited on Oct 23, 2014 at 12:45pm
Oct 23, 2014 at 1:34pm
How do i make sure that output is produced in cmd/stdout?
For windows use con device:

prog.exe < con > nul receives input from console and send output to nothing


BTW, cin/stdin (and out counterparts) are standard streams which can be redirected by OS.
so in prog.exe <input.txt> output.txt output.txt is your stdout
Last edited on Oct 23, 2014 at 1:36pm
Oct 23, 2014 at 6:37pm
This did it.
Thanks a ton!
Topic archived. No new replies allowed.