| Electronic Components Datasheet Search |
|
78K Datasheet(PDF) 56 Page - NEC |
|
|
|||||||||||||||||||||||||||||
78K Datasheet(HTML) 56 Page - NEC |
|
56 / 523 page ![]() CHAPTER 3 DECLARATION OF TYPES AND STORAGE CLASSES User’s Manual U15556EJ1V0UM 56 (3) Bit field A bit field is an integral type area consisting of a specified number of bits. For the bit field, int type, unsigned int type, and signed int type data can be specified. Note 1 The MSB of an int field which has no qualifier or a signed int field will be judged as a sign bit. Note 2 If two or more bit fields exist, the second and subsequent bit fields are packed into the adjacent bit positions, provided there is an ample space within the same memory unit. By placing an unnamed bit field with a width of 0, the next bit field will not be packed into a space within the same memory unit. An unnamed bit field has no declarator and declares a colon and a width only. The unary & operator (address) cannot be applied to a bit field object. Notes 1. In this compiler, char type, unsigned char type, and signed char type can also be specified. All of them are regarded as unsigned type since this compiler does not support signed type bit fields. 2. In this compiler, the direction of bit field allocation can be changed using the compiler option –RB (for details, refer to CHAPTER 11 EXTENDED FUNCTIONS). The following shows an example of a bit field. struct data { unsigned int a:2; unsigned int b:3; unsigned int c:1; } no1 ; 3.2.2 Enumeration specifiers An enumeration type specifier indicates a list of objects to be put in sequence. Objects to be declared with the enum specifier will be declared as constants that have int types. The enumeration specifier is declared as shown below. enum [identifier] {enumerator list} Objects are declared according to an enumerator list. Values are defined for all objects in the list in the order of their declaration by assigning the value of 0 to the first object and the value of the previous object plus 1 to the 2nd and subsequent objects. A constant value may also be specified by “=”. In the following example, “hue” is assumed as the tag name of the enumeration, “col” as an object that has this (enum) type, and “cp” as a pointer to an object of this type. In this declaration, the values of the enumeration become “{0, 1, 20, 21}”. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |