Systemnahe Programmierung in C: Aufzählungs-Datentypen |
|
1/* enum decl */
2
3enum color
4{ red, blue, green };
5
6/* variable declarations */
7
8enum color c1, c2, c3;
9
10
11/* type definition */
12
13typedef enum color Color;
14
15/* variable declaration */
16
17Color myColor;
18
19
20enum sizes
21{
22 small,
23 medium = 10,
24 big,
25 large = 20
26};
27
28enum people
29{
30 john = 1,
31 mary = 19,
32 bill = -4,
33 sheila = 1
34};
|
Letzte Änderung: 18.10.2005 | © Prof. Dr. Uwe Schmidt |