Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!cbmvax!ken From: ken@cbmvax.commodore.com (Ken Farinsky - CATS) Newsgroups: comp.sys.amiga.programmer Subject: Re: Is this valid C? Message-ID: <21278@cbmvax.commodore.com> Date: 6 May 91 14:31:25 GMT References: <1991May5.222328.16225@csis.dit.csiro.au> Reply-To: ken@cbmvax.commodore.com (Ken Farinsky - CATS) Organization: Commodore, West Chester, PA Lines: 33 In article <1991May5.222328.16225@csis.dit.csiro.au> dave@csis.dit.csiro.au (David Campbell) writes: >Is this valid C? > >Its just that this will compile on my favourite Unix compiler but won't >on Lattice V5.10. > >/*----------(code removed)--------------------------------------------*/ >-- Dave Campbell -- dave@csis.dit.csiro.au Try something like this, and make sure that you have "t" defined in some other source file (you have it extern): struct thing { int n; char *s; }; extern struct thing t; main() { t.n = 10; t.s = "hello"; } Your problem was defining the structure after the reference. Some compliers may allow this, SAS does not seem to. -- -- Ken Farinsky - CATS - (215) 431-9421 - Commodore Business Machines uucp: ken@cbmvax.commodore.com or ...{uunet,rutgers}!cbmvax!ken bix: kfarinsky