Okay, there is another problem I don't know how to solve.

I use a while loop to dictate wether to continue asking the user for input, or end at their request. If they type the number 1, the loop stops and the file is closed, program ends. The problem is that 1 is still sent to the file. Here is the loop:

Code:
while(toFile != "1")
    {
    cout << "Type in your text, pressing 'enter' when finished with the line (typing 1 will end the loop and close your file): \n";
    getline(cin, toFile);
    out << toFile;
    }