Using this statement, [code=cpp]getline( LoadText, loadTextString );[/code], how come it only saves the first word to 'LoadTextString'? Is there any way to store all words typed out on that line?
Here is my code for that section:
[code=cpp] case 2: //RETRIEVE TEXT -- LoadText("SAVEDATA.txt")
if (LoadText.is_open())
{
while (! LoadText.eof() )
{
getline( LoadText, loadTextString );
cout << loadTextString << endl;
}
LoadText.close();
}
break;[/code]
1>c:\documents and settings\brad\my documents\visual studio 2008\projects\fstreamconsole\fstreamconsole\fstreamconsole.cpp(101) :
error C2661: 'std::basic_istream<_Elem,_Traits>::getline' : no overloaded function takes 1 arguments
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
Here is the save code:
[code=cpp]case 1: //SAVE TEXT -- SaveText
cout << "Enter some text to save: ";
SaveText.open("SAVEDATA.txt");
cin.getline( saveTextString );
SaveText << saveTextString;
SaveText.close();
break;[/code]