English
Language : 

CC78K0S Datasheet, PDF (50/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 2 CONSTRUCTS OF C LANGUAGE
(2) Octal constant
An octal constant is an integer value with a base of 8 and must begin with 0 followed by any numbers 0 through
7 (example: 034U).
(3) Hexadecimal constant
A hexadecimal constant is an integer value with a base of 16 and must begin with 0x or 0X followed by any
numbers 0 through 9 and a through f or A through F which represent 10 through 15 (example: 0xF3).
The type of integer constant is regarded as the first of the “representable type” shown below.
In this compiler, the type of the unsubscripted constant can be changed to char or unsigned char depending on
the compile condition (option).
(Integer constant)
(Representable type)
• Unsuffixed decimal number.................................. int, long int, unsigned long int
• Unsuffixed octal, hexadecimal number ................ int, unsigned int, long int, unsigned long int
• Suffixed u or U...................................................... unsigned int, unsigned long int
• Suffixed l or L ....................................................... long int, unsigned long int
• Suffixed u or U, and suffixed l or L ....................... unsigned long int
2.4.3 Enumeration constants
Enumeration constants are used for indicating an element of an enumeration type variable, that is, the value of an
enumeration type variable that can have only the specific value indicated by an identifier.
The enumeration type (enum) is whichever is the first type from the top of the list of three types shown below that
can represent all the enumeration constants. The enumeration constant is indicated by the identifier.
• signed char
• unsigned char
• signed int
It is described as ‘enum enumeration type {list of enumeration constant}’.
Example enum months{January=1,February,March,April,May};
When the integer is specified with =, the enumeration variable has the integer value, and the
following value of enumeration variable has that integer value + 1. In the example shown above, the
enumeration variable has 1, 2, 3, 4, 5, respectively. When there is not ‘= 1’, each constant has 0, 1,
2, 3, 4, 5, respectively.
50
User’s Manual U14872EJ1V0UM