English
Language : 

CC78K4 Datasheet, PDF (57/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 3 DECLARATION OF TYPES AND STORAGE CLASSES
enum hue {
chartreuse,
burgundy,
claret=20,
winedark
};
enum hue col, *cp ;
void main (void) {
col = claret ;
cp = &col ;
/*...*/ (*cp != burgundy) /*...*/
:
3.2.3 Tags
A tag is a name given to a structure, union, or enumeration type. A tag has a declared data type and objects of
the same type can be declared with a tag.
The identifier in the following declaration is a tag name.
structure/union identifier {member declaration list}
or
enum identifier {enumerator list}
A tag has the contents of the structure/union or enumeration defined by a member. In the next and subsequent
declarations, the structure of a struct, union, or enum type becomes the same as that of the tag’s list. In the
subsequent declarations within the same scope, the list enclosed in braces must be omitted. The following type
specifier is undefined with respect to its contents and thus the structure or union has an incomplete type.
struct/union identifier
A tag to specify the type of this type specifier can be used only when the object size is unnecessary. This is
because by defining the contents of the tag within the same scope, the type specification becomes incomplete.
In the following example, the tag “tnode” specifies a structure that includes pointers to an integer and two objects
of the same type.
struct tnode {
int count;
struct tnode *left, *right ;
};
The next example declares “s” as an object of the type indicated by the tag (tnode) and “sp” as a pointer to the
object of the type indicated by the tag. By this declaration, the expression “sp → left” indicates a pointer to “struct
tnode” on the left of the object pointed to by “sp” and the expression “s.right → count” indicates “count”, which is a
member of “struct tnode” on the right of “s”.
User’s Manual U15556EJ1V0UM
57