How to read a sentence from a file?

So I'm working on that program that uses .txt files to store data, and I have one problem: I can't recover one full name from the .txt file
It's a school library program and it uses the <fstream> library for file operations, it stores theBookSignature >> theNameOfTheAuthor >> theBooksName.

I understand that C++ stops the input of a line when it stumbles upon a space, but isn't there something like a getline(cin, variableName) for file streams?
isn't there something like a getline(cin, variableName) for file streams?
There is. It is called getline. First parameter is the stream you read from. Place your file stream name instead of cin.
Last edited on
Thanks, it works (would be sad if it wouldn't (http://www.cplusplus.com/forum/general/152044/))
I'm a bit overworked thats all :)
Topic archived. No new replies allowed.