Pointers, Structs, and Arrays

Andrew Koenig ark at alice.UUCP
Wed May 10 03:18:09 AEST 1989


In article <743 at mccc.UUCP>, pjh at mccc.UUCP (Pete Holsberg) writes:

> 		*list[i].bar = '\0';

> 
> Now I know that the last line points to the first character in the bar array
> In each struct variable, but how?  If bar = &bar[0], how so the '*' and the
> '&' "get together" to make the last line equivalent to
> 		list[i].bar[0]

Easy ... `.' binds more tightly than any unary operator, so

		*list[i].bar

is equivalent to

		*(list[i].bar)
-- 
				--Andrew Koenig
				  ark at europa.att.com



More information about the Comp.lang.c mailing list