POV-Ray : Newsgroups : povray.off-topic : A puzzle about C (and probably C++)... : Re: A puzzle about C (and probably C++)... Server Time
3 Sep 2024 11:23:08 EDT (-0400)
  Re: A puzzle about C (and probably C++)...  
From: Kevin Wampler
Date: 17 Feb 2011 14:14:06
Message: <4d5d737e$1@news.povray.org>
As I recall in older versions of C you could only initialize the first 
element in a union, any remaining space being zero-initialized.  I think 
that if you don't specify a field name in the initialization it still 
sets the value of the first field.  Non totally sure though, since I 
rarely use unions in my code (the POD restriction gets in the way, and 
I'm not writing code where the memory reduction is really important anyway).


On 2/17/2011 10:29 AM, Darren New wrote:
>
> Under what circumstances does it matter what order the members of a
> union are written in? When does it make a difference as to which type
> inside the union is declared first?
>


Post a reply to this message

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