Your program is too complicated for someone starting out, simplify.
The code above doesn't compile, you should strip out everything and start with
cout << "Hello World!" << endl;
If you started with the above code, you'd know it's
Code one step, then test, code another... make sure it does what you want, make sure you know what it does....
As I said, too complicated, forget about the output file until your able to read the input file. You can't do anything with output until you have input and sort it.
Someone who has to do a "bubble sort" shouldn't be having these problems opening input files.
write a program flowchart
at the end of main.
always close the files you open.
You have a good start, took me a few mins to find the errors, for the most part it looks like it should work. There is not just one way to do something. Below is what I found worked for me.
I stripped out everything but what you needed to read a file, since that is what your having trouble with. I think the next thing you will want to do is read it into an array, then sort it, then output the array to a file. Should be fun, enjoy!
cout << "Please enter the name of the file you wish to open:\n";
cin >> textFile;
// do something with input here
cout << Line << endl;
else // Let user know if can't open the input file.
cout << "Unable to open file." << endl;