Question

It just occur to me that following command can print output in text file.

./a.out < infile.txt > actualoutput.txt

But i still wondering what < infile.txt > is for?

And what other arguments i can give when executing this object file?

Was it helpful?

Solution

this is the file that will be used as the standard input ( aka stdin ). Your command is the same as

cat infile.txt | a.out > output.txt

OTHER TIPS

The < infile.txt means take standard input from infile.txt.

Similarly > actualoutput.txt means to send standard output to actualoutput.txt.

For more information on redirection take a look here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top