A Question about nesting structures

Mark Brader ntt at dciem.UUCP
Thu Apr 12 03:32:03 AEST 1984


Mr. Crane, C is not COBOL, and structs are not "group items".
You know that this will not work:

	struct x { char a; int b; } y;
	read (0, &y, 3);

What you are supposed to do is read each item individually.
I don't think that it should make any difference that the items within
the group all turn out to be chars in the end.

I think you should use scanf instead of trying to read everything at once.

Mark Brader



More information about the Comp.lang.c mailing list