Abl-electronic PIC Microcontrollers PIC16 Manual de usuario Pagina 71

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 312
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 70
The order of constants can be explicitly re-arranged. For example:
enum colors { black,
// value 0
red,
// value 1
green,
// value 2
blue=6,
// value 6
violet,
// value 7
white=4 };
// value 4
Initializer expression can include previously declared enumerators. For example,
in the following declaration:
enum memory_sizes { bit = 1, nibble = 4 * bit,
byte = 2 * nibble, kilobyte = 1024 * byte };
nibble would acquire the value 4, byte the value 8, and kilobyte the value
8192.
Anonymous Enum Type
In our previous declaration, the identifier
colors is the optional enumeration tag
that can be used in subsequent declarations of enumeration variables of type
colors:
enum colors /jointfilesconvert/1192046/bg, border;
// declare variables /jointfilesconvert/1192046/bg and border
As with struct and union declarations, you can omit the tag if no further variables
of this enum type are required:
/* Anonymous enum type: */
enum {black, red, green, blue, violet, white} color;
Enumeration Scope
Enumeration tags share the same name space as structure and union tags.
Enumerators share the same name space as ordinary variable identifiers. For more
information, consult Name Spaces.
MikroElektronika:
Development
tools
-
Books
-
Compilers
63
page
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
Vista de pagina 70
1 2 ... 66 67 68 69 70 71 72 73 74 75 76 ... 311 312

Comentarios a estos manuales

Sin comentarios