struct assignment question

Jim Kohli kohli at gemed
Fri Mar 16 08:04:57 AEST 1990


In article <31530005 at hpcvia.CV.HP.COM>,brianh at 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



More information about the Comp.lang.c mailing list