ReAl (29.06.2006 05:01, просмотров: 1) ответил ReAl на Что-то я в ИАР-е не понял... Он что, не жрёт такое:
О, в C99rationale это ещё чётче написано 6.5.2.2 Function calls
Pointers to functions may be used either as (*pf)() or as pf(). The latter construct, notsanctioned in K&R, appears in some present versions of C, is unambiguous, invalidates no old code, and can be an important shorthand. The shorthand is useful for packages that present only one external name, which designates a structure full of pointers to objects and functions: member functions can be called as graphics.open(file) instead of
(*graphics.open)(file).
The treatment of function designators can lead to some curious, but valid, syntactic forms.
Given the declarations
int f(), (*pf)();
then all of the following expressions are valid function calls:
(&f)(); f(); (*f)(); (**f)(); (***f)();
pf(); (*pf)(); (**pf)(); (***pf)();
The first expression on each line was discussed in the previous paragraph. The second is conventional usage. All subsequent expressions take advantage of the implicit conversion of a function designator to a pointer value, in nearly all expression contexts. The C89 Committee saw no real harm in allowing these forms; outlawing forms like (*f)(), while still permitting
*a for a[], simply seemed more trouble than it was worth.