offsets in structures.

Ron Natalie <ron> ron at brl-tgr.ARPA
Thu Oct 11 05:05:18 AEST 1984


This is useful except on the VAX it don't work for bit fields (now
before you scream, let me demonstrate...)

	sturct	foo  {
		int	x;
		char	a:4, b:4;
		char	c;
	};

You can't find the offset of the char that contains a and b.
Just another reason for not using bitfields, I guess.

-Ron



More information about the Comp.lang.c mailing list