 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Fri Oct 27, 2006 9:10 am Post subject: Read file of multiple data types. |
|
|
I have a file where I know the lines go as follows:
string
long
string
int
int
string
double
it then repeats this sequence multiple times. I can use getline() to
get the data, but I need to be able to use the ints, doubles, and longs
without them being strings or char[]. The strings also have an unknown
amount of spaces in each one, so i can't use >> to get the data. At
least not that I can get to work. Is there a way to get the different
data into variables of the correct types? If there is a way to convert
them after I use getline() that would work too. |
|
| Back to top |
|
 |
David Harmon Guest
|
Posted: Fri Oct 27, 2006 9:11 am Post subject: Re: Read file of multiple data types. |
|
|
On 26 Oct 2006 23:13:08 -0700 in comp.lang.c++,
computerwolf8 (AT) gmail (DOT) com wrote,
| Quote: | I can use getline() to
get the data, but I need to be able to use the ints, doubles, and longs
|
strtod()
strtol() |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|