POV-Ray : Newsgroups : povray.off-topic : C++ questions : Re: C++ questions Server Time
6 Sep 2024 23:24:22 EDT (-0400)
  Re: C++ questions  
From: Darren New
Date: 24 Sep 2008 14:06:30
Message: <48da81a6@news.povray.org>
Warp wrote:
>   I don't remember for sure, but I think that the standard might say
> something that if you access the data behind a null pointer the program
> will be terminated.

I would be surprised if running off the end of an array is undefined but 
accessing the null pointer is defined. It would prevent C++ from being 
standards-compliant in lots of places that don't have memory management 
hardware. I wouldn't be surprised if the number of such systems actually 
outnumbers the number of systems *with* memory protection, once you 
start counting cell phones, microwave ovens, televisions, etc.

However, you may very well be right. I'm just guessing from 
what-should-be-reasonable. :-)

>   At least in practice this is so in all the most common systems.

Most common desktop systems, yes. I suspect this is more a POSIX thing 
than a C++ thing, really.

-- 
Darren New / San Diego, CA, USA (PST)


Post a reply to this message

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