0

I just started on SPOJ. It tests by redirecting standard input and output to files. Is there a way to do that directly from the terminal instead of modifying the program.

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by v3ga
0

If your on linux you can use the '<' operator. As in ./app < fileName it gets the input from the file instead of direct terminal.

0

If your on linux you can use the '<' operator. As in ./app < fileName it gets the input from the file instead of direct terminal.

So after compiling should i use ./a.out < filename ?
What about output?

0

If you want to redirect the output from terminal you use the '>' operator to a file. As in ./app < inputFile > outputFile

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.