ANSII C structures and unions

Alan Fargusson alan at drivax.UUCP
Tue Apr 23 10:26:08 AEST 1985


I noticed that the standard has defined structures and unions
in such a way as to break most of my code. I don't like this
very much. I only got a copy of the standard a couple of weeks
ago, and have been playing with the grammer that someone posted
to the net. It didn't take me long to find anything that includes
stdio.h fails because of the structure problem.

The way I read the standard a structure must be declared as a template
with a tag before being used to declare a variable. For example:

	struct pig { int a; int b; };
	struct pig hog;

Not like this:

	struct { int a; int b; } hog;

Has this been hashed over before? If it was I missed it.
-- 

Alan Fargusson.

{ ihnp4, sftig, amdahl, ucscc, ucbvax!unisoft }!drivax!alan



More information about the Comp.lang.c mailing list