Re: Data structures question



Shwetabh <shwetabhgoel@xxxxxxxxx> wrote:

> My question is, why are data structures implemented only with struct
> data type?
> Why not union when it is more efficient as compared with structures?

Well, depending on what I need to do, I will use which ever one is most
appropriate.

They are not interchangeable, but since you seem to be implying that
they are, I am wondering if you really understand the differences
between them.

.



Relevant Pages

  • Re: Data structures question
    ... Shwetabh wrote: ... why are data structures implemented only with struct ... > Why not union when it is more efficient as compared with structures? ...
    (comp.lang.c)
  • Data structures question
    ... why are data structures implemented only with struct ... Why not union when it is more efficient as compared with structures? ... Prev by Date: ...
    (comp.lang.c)
  • Re: Data structures question
    ... Shwetabh wrote on 26/07/05: ... If you want an union, ... The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html The C-library: http://www.dinkumware.com/refxc.html ...
    (comp.lang.c)
  • Re: Why not unions
    ... > Why are only structures used for implementing data structures. ... lets say we have a struct like this: ... enum thing what_it_is; ... union bar b; ...
    (comp.programming)
  • Re: Java casting craziness
    ... Is there an elegant way to handle retrieving objects from data structures such as ArrayLists and Stacks without having to cast the object I removing to the data type that it should all ready be? ... public Rule get{ ...
    (comp.lang.java.help)