You cannot do this directly in Visual Studio. I / O redirection is a feature of the shell, not VS. You can open a command prompt, go to the directory where the executable is located, and run the command:
myprogram.exe < test.txt
(suppose test.txt is also in this directory if you cannot always use the full pathnames).
Refresh . Perhaps you can do what you want by asking VS to run a command prompt for you and running the program. Under "Configuration Properties" | Debugging, replace the one in the Command field (usually $ (TargetPath)):
cmd.exe /c "$(TargetPath)" < source-file
Leave the command arguments blank. I have never tried this. Perhaps this will not work.
source share