Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!genrad!decvax!ucbvax!ulysses!hector!jss From: jss@hector.UUCP Newsgroups: comp.lang.c Subject: Re: Copying a constant number of bytes Message-ID: <2658@ulysses.homer.nj.att.com> Date: Mon, 15-Jun-87 10:19:56 EDT Article-I.D.: ulysses.2658 Posted: Mon Jun 15 10:19:56 1987 Date-Received: Wed, 17-Jun-87 01:07:56 EDT References: <900@bloom-beacon.MIT.EDU> Sender: daemon@ulysses.homer.nj.att.com Reply-To: jss@hector (Jerry Schwarz) Distribution: world Organization: AT&T Bell Labs, Murray Hill Lines: 13 In article <900@bloom-beacon.MIT.EDU> newman@athena.mit.edu (Ron Newman) writes: > >Method 2) > > struct nbytes {char s[NBYTES];}; > *(struct nbytes *)b = *(struct nbytes *)a; > > This may work on some machines, but it is not portable. At least NBYTES will be copied, but since the compiler is normally allowed to add padding at the end of "struct nbytes" it is also allowed to copy the padding.