POV-Ray : Newsgroups : povray.off-topic : C++ questions : Re: C++ questions Server Time
7 Sep 2024 05:09:00 EDT (-0400)
  Re: C++ questions  
From: Slime
Date: 25 Sep 2008 01:28:19
Message: <48db2173@news.povray.org>
> Does C++ check whether a pointer you're deferencing is zero? Or will it 
> just segfault?

In practice it segfaults. Any time you think there's even a chance of this 
happening, do

assert( ptr );

to catch it ahead of time. (This will assert that it is not 0, or NULL). 
You'll save yourself some headaches.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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