Consider a basic program - SumOf2Numbers.cpp. I can give 2 number as input through command line and it give the sum of the number.
I want to run this program with various inputs like,
./a.out 5 6
./a.out 123456 654321
./a.out -200 200
And the output would be,
5 + 6 = 11
-200 + 200 = 0
123456+654321 = 777777
I want to automate this process of executing the c++ code and storing the output in a file. I am new to writing scripts. I would like to know how I can do this ? I believe I can do this by writing perl or bash scripts. Can someone guide me to a nice tutorial on this.
PS: I am sure there would be lot of online tutorials. But I am not sure how exactly I should perform the search.