English
Language : 

CC78K0S Datasheet, PDF (89/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 5 OPERATORS AND EXPRESSIONS
5.4 Cast Operator
A cast is a special operator which forces one data type to be converted into another. The cast operator is mainly
used when converting a pointer type.
Cast Operator
(type-name)
FUNCTION
The cast operator converts the data type of another object (or the result of another expression) into the type
specified in parentheses ( ).
SYNTAX
(type-name) expression
EXAMPLE
void func(void){
int val;
float f;
f=3.14F;
val=(int)f;
/* val becomes 3 by cast */
val=*(int *)0x10000; /* cast constant */
}
User’s Manual U14872EJ1V0UM
89