I am trying to read a file but I would like the user to enter the name of the file. This is the code that works when you add a static file into the code.

Code:
     inFile.open (xyz.txt);
     inFile >> length;
     inFile.close ();
This is what I would like for the user to enter in the file name, but it does not work.

Code:
     cout << "Enter The Name Of the File"<< endl;
     cin >> input;
     inFile.open (input);
     inFile >> length;
     inFile.close ();

Thanks for your time and help.