
November 19th, 2004, 08:35 AM
|
|
Registered User
|
|
Join Date: Nov 2004
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
getline with mixed data
Hi all. I am getting extremely frustrated with this. I am reading info from a file into a linked list. The file's data is like this:
string int string int
I would like to be able to have spaces in the strings and still use the fstream getline function. It works great for the strings, but it won't read the int's as int and won't convert from char * to int. I realize that this is a very basic question and that it has probably been answered a million times, but no matter how many tutorials I read, I can never find the solution.
As a sort of side note, can anyone tell me why my getline statements for iostreams require me to hit enter twice? I can post as a different thread if necessary.
I'm using MS Visual C++ 6.
Thanks
|