Basically I want the name of the file the user inputs to be assigned to a string(File2) and I want that string (File2) to be useable in int Main().
Whenever I test cout << File2; in Main(), its empty.
I have also declared the string File2 in int Main() (I know that variables are different in Main and Functions) but I want to know if its possible for me to use the string in Main.
Added a semicolon on line 14 to make it compile. Depending on your version of c++ you may or may not have to convert to c-strings when opening files. Otherwise it seemed to run OK as below.