c/language/operator other

A collection of operators that do not fit into any of the other major categories.

Function call
The function call expression has the form

where

The behavior of the function call expression depends on whether the prototype of the function being called is at the point of call.

Call to a function with a prototype
@1@ The number of parameters must equal the number of arguments (unless the ellipsis parameter is used). @2@ The type of each parameter must be a type such that exists that converts the unqualified type of the corresponding argument to the type of the parameter.

@3@ The arguments are evaluated. @4@ is performed to copy the value of each argument to the corresponding function parameter, ignoring any type qualifiers on the parameter type and its possibly recursive elements or members, if any (note: the function can modify its parameters, and those changes do not affect the arguments; C function calls are only call-by-value).
 * if there is a parameter,   are performed on the remaining arguments, which are made available to va_list.

@5@ Function is executed, and the value it returns becomes the value of the function call expression (if the function returns void, the function call expression is a void expression)

{{rrev|until=c23|

Call to a function without a prototype
@1@ The arguments are evaluated. @2@ are performed on every argument expression. @3@ is performed to copy the value of each argument to the corresponding function parameter, ignoring any type qualifiers on the parameter type and its possibly recursive elements or members, if any. @4@ Function is executed, and the value it returns becomes the value of the function call expression (if the function returns void, the function call expression is a void expression)

The behavior of a function call to a function without a prototype is undefined if
 * the number of arguments does not match the number of parameters.
 * the promoted types of the arguments are not with the promoted types of the parameters except that
 * signed and unsigned versions of the same integer type are considered compatible if the value of the argument is representable by both types.
 * pointers to void and pointers to (possibly cvr-qualified) character types are considered compatible

}}

Comma operator
The comma operator expression has the form

where

First, the left operand,, is evaluated and its result value is discarded.

Then, a takes place, so that all side effects of  are complete.

Then, the right operand,, is evaluated and its result is returned by the comma operator as a.

Cast operator
See

Conditional operator
The conditional operator expression has the form

where

Only the following expressions are allowed as and
 * two expressions of any
 * two expressions of the same or  type
 * two expressions of void type
 * two expressions of pointer type, pointing to types that are, ignoring cvr-qualifiers


 * one expression is a pointer and the other is the null pointer constant (such as null)
 * one expression is a pointer to object and the other is a pointer to void (possibly qualified)

@1@ First, evaluates. There is a after this evaluation. @2@ If the result of compares unequal to zero, executes, otherwise executes @3@ Performs a from the result of the evaluation to the common type, defined as follows:
 * @1@ if the expressions have arithmetic type, the common type is the type after
 * @2@ if the expressions have struct/union type, the common type is that struct/union type
 * @3@ if the expressions are both void, the entire conditional operator expression is a void expression
 * @4@ if one is a pointer and the other is a null pointer constant, the type is the type of that pointer
 * @5@ if both are pointers, the result is the pointer to the type that combines cvr-qualifiers of both pointed-to types (that is, if one is and the other is, the result is ), and if the types were different, the pointed-to type is the.
 * @6@ if one is a pointer to void, the result is a pointer to void with combined cvr-qualifiers

operator
See

operator
See