A problem with ifstream/ofstream

I do not have much experience with c++, but I am trying to learn. My current project is a scheduler, something that stores data to a file and reteives it based on the date. I had some trouble getting getline to work properly, but my main problem is that the data is stored to the file with spaces. Great, I want my program to store spaces. But when I go to retreive data, it only retieves to the first space. For example, january 5 stores "go to dentist". When I retreive, january 5 has "go", 6 has "to", and 7 has "dentist". How do I get it to retreive the whole line regardless of spaces?
It will be easier for someone to help if you post your code.
if the file format is like this
go to dentist (newline)
do something else
Getline should do what you need:
1
2
3
string line;
getline ( your_file_stream, line );
// line == "go to dentist" 
Thanks for the help, sorry about not posting the code, I was in a hurry. The program works fine now.
Topic archived. No new replies allowed.