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?
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.txtoutput.txtis your stdout