English
Language : 

CC78K0S Datasheet, PDF (80/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 5 OPERATORS AND EXPRESSIONS
(2) Function call
Postfix Operators
( ) Function Call
FUNCTION
The postfix operator ( ) calls a function. The function to be called is specified with a postfix expression and
argument(s) to passed to the function are indicated in parentheses ( ).
The description related to the function includes the function prototype declaration, the function definition (the
body of the function), and the function call. The function prototype declaration specifies the value a function
returns, the type of argument, and the storage class.
If the function prototype declaration is not referred to in a function call, each argument is extended with a general
integer. This is called “default actual argument extension”. Performing a function prototype declaration avoids
default actual argument extension and detects the mistakes of the type and number of arguments and the type
of the return value.
Calling a function which has neither a storage class specification nor a data type specification such as “identifier
();” is interpreted as calling a function which has an external object and returns an int type which has no
information on arguments. In other words, the following declaration will be made implicitly:
extern int identifier ();
SYNTAX
postfix-expression ( argument-expression list );
[Example of function call]
int func(char,int);
char a;
int b,ret;
void main(void){
ret=func(a,b);
}
int func(char c, int i){
.
.
.
return i;
}
/* function prototype declaration */
/* function call */
/* function definition */
NOTE
A function that returns an object other than array types can be called with this operator. The postfix expression
must be of a pointer type to this function.
In a function call including a prototype, the type of argument must be of a type that can be assigned to the
corresponding parameter(s). The number of arguments must also be in agreement.
80
User’s Manual U14872EJ1V0UM