Reputation: 1589
I need to take standard input to my .exe file from in.txt and push output to out.txt like:
$ a.exe < in.txt > out.txt
I know that with >
you can forward output from std::cout
to a file, but I don't know how to get input from a file like that.
Upvotes: 1
Views: 321
Reputation: 1529
<
is putting the data on the standard input stream. So std::cin
is the way to go.
Upvotes: 3