Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!uw-beaver!tektronix!tekcrl!tekfdi!bobb From: bobb@tekfdi.TEK.COM (Robert Bales) Newsgroups: comp.sys.amiga Subject: Re: Byte/word/long alignment Keywords: none Message-ID: <1638@tekfdi.TEK.COM> Date: 14 Jan 88 02:38:59 GMT References: <4366@garfield.UUCP> Reply-To: bobb@tekfdi.UUCP (Robert Bales) Distribution: na Organization: Tektronix, Inc., Beaverton, OR. Lines: 18 In article <4366@garfield.UUCP> john13@garfield.UUCP (John Russell) writes: >If I want to create an auto-initialized array of UBYTES, and then later >access each 4 bytes as a longword, can I ensure that the array is longword >aligned in some portable way (eg by placing it immediately after some other >32-bit global variable)? Perhaps by using a union containing the array of UBYTES and a longword. Such a technique is illustrated on page 173-174 of K&R. I say "perhaps" because I don't know if a union can be auto-initialized. (A quick search of K&R didn't yield the answer.) "See you at AmiExpo" Bob Bales Tektronix, Inc. I help Tektronix make their instruments. They don't help me make my opinions.