In article <11*********************@a75g2000cwd.googlegroups. com>,
fo******@googlemail.com says...
[ having been told to use std::getline to read text including spaces ]
what fi there is more data in that line in the text file. I got to
include population etc.
You'll need something specific that separates one item on the line from
the next. By default, the string extraction operator assumes that any
white-space character is such a separator. When you call getline, you
can specify a different character of your choice. For example, if
there's a comma between the name and the population of the city, you
could specify the comma as the separator.
What you need is a character that you're sure will NOT occur inside of a
data item, but WILL occur between them. If there is no such character,
then you probably want to change how you store the data.
--
Later,
Jerry.
The universe is a figment of its own imagination.