Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ihnp4!ptsfa!lll-lcc!seismo!rochester!cornell!batcomputer!itsgw!alyce From: alyce@itsgw.UUCP Newsgroups: comp.lang.c Subject: Re: Copying Structures Message-ID: <371@itsgw.UUCP> Date: Tue, 24-Feb-87 13:51:58 EST Article-I.D.: itsgw.371 Posted: Tue Feb 24 13:51:58 1987 Date-Received: Sun, 1-Mar-87 12:34:28 EST References: <4741@ut-ngp.UUCP> Lines: 17 Summary: structure assignment is relatively new In article <4741@ut-ngp.UUCP>, jjr@ut-ngp.UUCP (Jeff Rodriguez) writes: [ For struct {float foo[100], bar[100];} x, y; ] > I have found that > y = x; > does the same thing as > for(i = 0; i < 100; i++) > { y.foo[i] = x.foo[i]; y.bar[i] = x.bar[i]; } > Is this shortcut portable? Does the ANSI standard allow it? Structure assignment is relatively new (Sys V or maybe even SVR2 on AT&T UNIX -- don't know about Berkeley), so don't count on it being at all portable! Alyce Faulstich ...!seismo!rpicsv!rpitsgw!alyce alyce@itsgw.rpi.edu