-
That doesn't put each word on a new line. It does put each line on a new line. Did you try it? I think you tried if before you switched to getline.
There are two parts to this. Input and output.
Using getline for input means that the entire line that you type will be read into text.
Using file << text << endl for output means that the entire string stored in text is output the file on its own line.
Combining the two means that the entire line you type into the console is added on its own line in the file. That's what you want.
-
Yes, thanks alot for your time and help! It works fine now.