Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cunixf.cc.columbia.edu!cubmol!ping From: ping@cubmol.bio.columbia.edu (Shiping Zhang) Newsgroups: comp.lang.c Subject: Re: Need help with union trick Message-ID: <1991Jan3.022703.5609@cubmol.bio.columbia.edu> Date: 3 Jan 91 02:27:03 GMT References: <1991Jan3.005700.20623@lavaca.uh.edu> Reply-To: ping@cubmol.bio.columbia.edu (Shiping Zhang) Organization: Dept. of Biology, Columbia Univ., New York, NY Lines: 19 In article <1991Jan3.005700.20623@lavaca.uh.edu> jet@karazm.math.uh.edu ("J. Eric Townsend") writes: >I have a body of code with the following structure: >typedef struct pointstruct { > double x,y,z; > } Point; >I would like to be able to reference the elements as an array without >having to rewrite the existing code. (We've got code to be pasted in that >relies on being able to grab the x, y and z as array indicies. Grr. :-) How about this typedef double Point[3]; -ping