On Thu, 2005-11-24 at 08:07 +0200, Shane Shields wrote:
> Gerard Beekmans wrote:
> 
> > Gerard Beekmans wrote:
> >
> >> It's probably something elemental to seasoned programmers. Anybody 
> >> care to explain? :)
> >
> >
> > Ah found it. Apparently it's for historical reasons. The in_addr 
> > structure used to be a union of various structures. Networking 
> > changed, the union became unneeded and in_addr is left as a structure 
> > with just that single in_addr_t member.
> >
> > What's a union? :)
> >
> A union is basically the same as a structure. Same syntax, same method 
> of calling. I suppose you could call a union a subset of a structure. A 
> structure is more expandable/scalable though.

in an union all elements share the same memory, so that the size of an
union is (at least) that of the biggest member.
the size of a structure is (at least) that of all members of that
structure.

-- 
  H
CUH Rainer Peter Feller
  H

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to