Asking user input for file name to be used.

I was given an assignment to write a program that will read the contents from data files and calculate a paycheck after all the tax deductions. The only problem I have is that I can't think of how to ask the user to type the file name and get the program to find the correct file. If anyone has any input on how to do this, please let me know. Thank you.

Myles
1
2
cin >> astringvar;
fstream(astringvar);

IIRC it should be that simple. Declare a var of std::string.
Check the tutorial on file IO just in case because it's been a while since I did this.
Thank you tummychow.
See if it works before thanking me. =] But no prob.
Topic archived. No new replies allowed.