POV-Ray : Newsgroups : povray.off-topic : Quick C language-lawyer question... : Re: Quick C language-lawyer question... Server Time
5 Sep 2024 11:22:09 EDT (-0400)
  Re: Quick C language-lawyer question...  
From: Darren New
Date: 30 Jul 2009 16:31:43
Message: <4a72032f$1@news.povray.org>
Le_Forgeron wrote:
> Well, it will be portable. memset() will work.
> But if later you expect to check the pointer against NULL, you will be disappointed.

Well, yes, that's what I was asking.

> In C++,  you could make a class for your structure, and have a nice constructor to
set
> NULL in y; But that might somehow conflict with the usage of the union...

The union was just an unambiguous demonstration of what I meant by "the bit 
pattern of a NULL pointer in memory." It's not actual code.

> Mixing a value and a pointer is a non-sense, unless you provide a real & sensible
usage.

memset() was more what I was talking about, which clearly mixes pointers and 
values if you apply it to a structure with pointers in it.

-- 
   Darren New, San Diego CA, USA (PST)
   "We'd like you to back-port all the changes in 2.0
    back to version 1.0."
   "We've done that already. We call it 2.0."


Post a reply to this message

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