File location

Can someone point me to the tutorial that will tell me how to have a user enter the location of a file that will be in ported into a program. I know how to do it in the code to a static location

 
in.open("araySale.dat");


but how do i write it so a user can type in C;/user/guest/my documents/newfile.txt
1
2
3
4
5
6
string fileName;

cout << "Enter file name: ";
cin >> fileName;

in.open(filename);
okay, too easy thanks.
Topic archived. No new replies allowed.