struct assignment question

brian_helterline brianh at hpcvia.CV.HP.COM
Thu Mar 15 02:02:11 AEST 1990


I have a simple question:

Can you assign a struct like any other data type?

An example:

struct {
	int a;
	int b;
	long c;
       } var1, var2;

  var1.a = 3;
  var1.b = 4;
  var1.c = 15L;

  var2 = var1;	/* <--- is this legal?  */


I was told it was not.  Is this always the case?  What does ANSI say?

Thanks the info.



More information about the Comp.lang.c mailing list