English
Language : 

CC78K0S Datasheet, PDF (62/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 3 DECLARATION OF TYPES AND STORAGE CLASSES
3.4 Declarators
A declarator declares an identifier. Here, pointer declarators, array declarators, and function declarators are
mainly discussed. The scope of an identifier and a function or object which has a storage duration and a type are
determined by declarators.
A description of each declarator is provided below.
3.4.1 Pointer declarators
A pointer declarator indicates that an identifier to be declared is a pointer. A pointer points to (indicates) the
location where a value is stored. Pointer declarations are performed as follows.
* type qualifier list identifier
By this declaration, the identifier becomes a pointer to T1.
The following two declarations indicate a variable pointer to a constant value and an invariable pointer to a
variable value, respectively.
const int *ptr_to_constant;
int *const constant_ptr;
The first declaration indicates that the value of the constant “const int” pointed by the pointer “ptr_to_constant”
cannot be changed, but the pointer “ptr_to_constant” itself may be changed to point to another “const int”. Likewise,
the second declaration indicates that the value of the variable “int” pointed by the pointer “constant_ptr” may be
changed, but the pointer “constant_ptr” itself must always point to the same position.
The declaration of the invariable pointer “constant_ptr” can be made distinct by including a definition for the pointer
type to the int type data.
The following example declares “constant_ptr” as an object that has a const qualifier pointer type to int.
typedef int *int_ptr;
const int_ptr constant_ptr;
62
User’s Manual U14872EJ1V0UM