Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!mailrus!uwm.edu!mrsvr.UUCP!kohli@gemed.ge.com From: kohli@gemed (Jim Kohli) Newsgroups: comp.lang.c Subject: struct assignment question Message-ID: <2321@mrsvr.UUCP> Date: 15 Mar 90 22:04:57 GMT References: <31530005@hpcvia.CV.HP.COM> Sender: news@mrsvr.UUCP Reply-To: kohli@gemed.ge.com (Jim Kohli) Organization: GE Medical, Applied Science Lab Lines: 23 In article <31530005@hpcvia.CV.HP.COM>,brianh@hpcvia.CV.HP.COM (brian_helterline) writes: >I have a simple question: > >Can you assign a struct like any other data type? > > [example deleted] > >I was told it was not. Is this always the case? What does ANSI say? > I don't know what the ANSI standard says, but K&R (rev 1) does leave some reasonable doubt w.r.t. this functionality being *required*. From page 121: "This implies that structures may not be assigned to or copied as a unit, and that they can not be passed to or returned from functions. (These restrictions will be removed in forthcoming versions.)" SUN supports struct to struct assignments-- I would advise that you check on your machine with your test program (and some modifications to verify the results). Jim Kohli GE Medical Systems