POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: My first C++ program Server Time
4 Nov 2024 17:36:42 EST (-0500)
  Re: My first C++ program  
From: Warp
Date: 20 Sep 2008 04:59:13
Message: <48d4bb61@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.