Function call expressions

A function call is an expression containing the function name followed by the function call operator, (). If the function has been defined to receive parameters, the values that are to be sent into the function are listed inside the parentheses of the function call operator. The argument list can contain any number of expressions separated by commas. It can also be empty.

The type of a function call expression is the return type of the function. This type can either be a complete type, a reference type, or the type void.

C only A function call expression is always an rvalue.

C++ A function call belongs to one of the following value categories depending on the result type of the function:

  • An lvalue if the result type is an lvalue reference type or an rvalue reference to a function type
  • An xvalue if the result type is an rvalue reference to an object type
  • A (prvalue) rvalue in other cases
Here are some examples of the function call operator:
overdue(account, date, amount)
notify(name, date + 5)
report(error, time, date, ++num)
The order of evaluation for function call arguments is not specified. In the following example:
method(sample1, batch.process--, batch.process);
the argument batch.process-- might be evaluated last, causing the last two arguments to be passed with the same value.