Newsgroups: comp.unix.wizards
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!dog.ee.lbl.gov!elf.ee.lbl.gov!torek
From: torek@elf.ee.lbl.gov (Chris Torek)
Subject: Re: help with a 'C' problemR
Organization: Lawrence Berkeley Laboratory, Berkeley
References: <1991Jun17.131027.8700@bnlux1.bnl.gov> <MOSS.91Jun18093601@ibis.cs.umass.edu> <1991Jun23.235734.11392@chinacat.unicom.com> <4825@inews.intel.com>
Message-ID: <14683@dog.ee.lbl.gov>
X-Local-Date: Tue, 25 Jun 91 15:42:51 PDT
Reply-To: torek@elf.ee.lbl.gov (Chris Torek)
Date: Tue, 25 Jun 91 22:42:51 GMT

In article <4825@inews.intel.com> bhoughto@pima.intel.com (Blair P. Houghton)
writes:
>	i = (fp->f_ops->fread_c)();
>The `()' operator has unspecified precedence wrt the `->' operator,
>hence the parentheses around the calling expression.

Minor correction: it is not `unspecified'; the expression

	fp->f_ops->fread_c()

must parse as

	(((fp)->f_ops)->f_read)()

`Classic C' compilers may require an indirection first; since function call
binds more tightly than indirection, you must write

	(*fp->f_ops->fread_c)()

in this case.
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427)
Berkeley, CA		Domain:	torek@ee.lbl.gov
