I have a simple C++ program that uses
cin to read eight numbers, and I'm running it in a bash shell. When I run it in the terminal, it looks like this (the user types in the numbers 1-8):
./add8 Please enter eight numbers: 1 2 3 4 5 6 7 8 The sum is: 36
I am trying to redirect a file that has the eight numbers (e.g., "1 2 3 4 5 6 7 8" and a newline) to the program, but the input does not show on the screen:
./add8 < my_eight_numbers.txt Please enter eight numbers: The sum is: 36
Is it possible to redirect the file into the program and show the input as if the user typed it?