Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Is simple assignment allowed with structs Message-ID: <15649@smoke.brl.mil> Date: 30 Mar 91 22:24:28 GMT References: Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 15 In article aj3u@wilbury.ra.cs.virginia.edu (Asim Jalis) writes: >The assignment from all appearances seems to copy both the fields of a >to b. My question is, is such assignment legal. Can I expect other >compilers to support this? Or should I explicitly assign the fields >to ensure portability. Structure assignment has been an official part of C since around 1978. While there MAY be some things loosely called "C compilers" that do not support this, all the current C compilers that I know of do support it. Since the C standard requires it for conforming implementations, there should be no future C compilers that do not understand this. >I tried adding two structs and that did not work. Of course not. What would it mean?