help with a 'C' problemR
Chris Torek
torek at elf.ee.lbl.gov
Wed Jun 26 08:42:51 AEST 1991
In article <4825 at inews.intel.com> bhoughto at 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 at ee.lbl.gov
More information about the Comp.unix.wizards
mailing list