English
Language : 

CC78K0S Datasheet, PDF (108/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 5 OPERATORS AND EXPRESSIONS
(1) Simple assignment operator
Simple Assignment Operator
=
FUNCTION
The = operator converts the right operand (expression) to the type of the left operand before the value is stored
in the left object.
In the following example, the value of an int type to be returned from the function by the type conversion of the
simple assignment expression will be converted to a char type and an overflow in the result will be truncated.
The comparison of the value with “–1” will then be made after the value is converted back to the int type. If the
variable “c” declared without a qualifier is not interpreted as unsigned char, the result of the variable will not
become negative and its comparison with “–1” will never result in equal. In such a case, the variable “c” must be
declared with an int type to ensure complete portability.
int f(void);
char c;
/*...*/ ((c=f())==-1) /*...*/
SYNTAX
E1 = E2
108
User’s Manual U14872EJ1V0UM