When we write code for online competition platforms, they read the test files as below
./a.out < test1
In the program we have cin statements which read the data from test1
Can this be run with gdb and still read the test in above manner automatically.
If this is not possible, then what best method can we use to debug this.
It is difficult to manually provide test data to the program.