Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: Order of allocation of fields in a struct? Message-ID: <13115@smoke.BRL.MIL> Date: 14 Jun 90 19:02:05 GMT References: <1563@diemen.cc.utas.oz> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 13 In article <1563@diemen.cc.utas.oz> charles@tasis.eecs.utas.edu.au (Charles Lakos) writes: >Can I then access the fields of v2 in the following way: > (t1 *) p -> b No, but ((t1 *)p)->b should work. You can count on a pointer to the first member of a struct being convertible to a pointer to the struct and vice-versa, and from various constraints in the standard it is possible to conclude that "all structure pointers smell the same", meaning that they have the same size and alignment requirements, so it is also possible to interconvert pointers to two different structure types.