A function call is a postfix expression.
Here in these expressuins
x = a * (b+c)-(d*e);
subexpressioins (b+c)
and (d*e)
are primary expressions. You may enclose any expression in parentheses and you'll get a primary expression.
For example you could even rewrite the expression statement the following way
( x = ( ( ( a ) * (b+c) )-(d*e) ) );
In this expression statement there are the following primary expressions
( a )
(b+c)
(d*e)
( ( a ) * (b+c) )
( ( ( a ) * (b+c) )-(d*e) )
( x = ( ( ( a ) * (b+c) )-(d*e) ) )
Here are some examples of postfix expressions
( *p )() // a function call
a[n] // using the subscript operator
x++; // using the postfix increment operator
The definition of a function call is
postfix-expression:
primary-expression
postfix-expression ( argument-expression-listopt )
From the C Standard (6.5.2.2 Function calls)
1 The expression that denotes the called function92) shall have type
pointer to function returning void or returning a complete object type
other than an array type.
Here are some examples of weird function calls.:)
#include <stdio.h>
void f( void )
{
printf( "Hello " );
}
void g( void )
{
puts( "Broman" );
}
int main( void )
{
void ( *funcs[] )( void ) = { f, g };
void ( **p_func )( void ) = funcs;
( *p_func++ )();
p_func[0]();
}
The program output is
Hello Broman
Take into account that in these calls
( *p_func++ )();
p_func[0]();
expression ( *p_func++ )
is a primary expression and expression p_func[0]
is a postfix expression (See the partial definition of the postfix expression above)