POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: My first C++ program Server Time
1 Oct 2024 00:09:12 EDT (-0400)
  Re: My first C++ program  
From: Warp
Date: 20 Sep 2008 04:45:04
Message: <48d4b810@news.povray.org>
Nicolas Alvarez <nic### [at] gmailcom> wrote:
> If you're writing C, you should use strtol instead. If you're writing C++,
> you should use a stringstream instead.

  As I said in my other post, there is merit in the C functions: They are
much more efficient than stringstreams.

  So if you are converting a *huge* amount of strings to ints in a tight
loop, you might want to consider the C functions rather than stringstreams.

  In situations where speed has absolutely no relevance stringstreams are
much easier and safer to use.

-- 
                                                          - Warp


Post a reply to this message

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