Mueen Nawaz <m.n### [at] ieeeorg> wrote:
> If you DO want to read a whole line, look up the getline function. That
> will also take in an "empty" line.
The problem with getline() is precisely that it reads an entire line.
If there are several whitespace-separated things in that line, it will
still read the entire line.
Of course you can give that line to istringstream and then read those
whitespace-separated things with >> (and check with good() to see if it
succeeds).
--
- Warp
Post a reply to this message
|