POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: My first C++ program Server Time
30 Sep 2024 19:28:11 EDT (-0400)
  Re: My first C++ program  
From: Orchid XP v8
Date: 19 Sep 2008 15:31:33
Message: <48d3fe15$1@news.povray.org>
Warp wrote:

>   What you can do is this:
> 
>     std::string s;
>     while(true)
>     {
>         std::cin >> s;
>         if(!std::cin.good()) break;
> 
>         int value;
>         std::istringstream iss(s);
>         iss >> value;
>         if(!iss.fail())
>             std::cout << "The input was an integer: " << value << "\n";
>         else
>             std::cout << "The input was something else: " << s << "\n";
>     }

"Variable 'iss' has initialiser but has incomplete type."

WTF...?

Oh, wait, I see. That means "you didn't include <sstream>". Well, that 
was quite clear. o_O

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

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