zero length array
woods at gpu.utcs.toronto.edu
woods at gpu.utcs.toronto.edu
Thu Feb 26 11:18:16 AEST 1987
In article <4498 at brl-adm.ARPA> Dizio at udel.edu writes:
> Is the following a portable way of finding out where a field
>within a structure is located?
>
> & (((struct any_struct_tag *) 0)->any_field)
Not that I know of, though the expression without "&" is usefull in sizeof().
Some compilers will refuse to cast NULL, specifically Lattice C up to 2.15(?)
As far as I know all Unix compilers will cast NULL.
You might want to cast one(1) instead. Lattice will accept this.
Greg Woods.
More information about the Comp.lang.c
mailing list