Wet assignments: How do I pass the test file name as an input parameter?
Follow: Run -> Run Configurations -> Arguments.
Write the relative path (relative to your project) or absolute path of the input file.
Don't forget to click "Apply" to make these changes relevant to the next run of your program.
In Visual Studio 2008:
Right click your project name (or choose "Project" from the upper bar) and choose "Properties".
Click on "Debugging" and enter the name of the test file under "Command Arguments".
Note that if you only write the filename (e.g. test1.txt), you should put the test1.txt in your working directory (by default, the directory in which your project is located).