Subj : Re: Why not unions To : comp.programming From : Jon Harrop Date : Tue Jul 26 2005 09:46 pm Shwetabh wrote: > Hi, my question is related with data structures. > Why are only structures used for implementing data structures. > Why not unions when they are more memory efficient than structures. This sounds like a question about struct and union in the C programming language. Both struct and union are used by C programs. However, struct is much more common than union. Also, union is unsafe and can easily be the cause of bugs. Many more modern languages (like OCaml and SML) provide safe alternatives to union called variant types. -- Dr Jon D Harrop, Flying Frog Consultancy http://www.ffconsultancy.com .