
→
Unions
union
union-name
{
data-type member1;
data-type member2;
...
data-type memberm;
} [
variable-list];
•
Description
Unions are a group of variables of differing types that share the same
memory space. A union is similar to a structure, but its memory usage is
very different. In a structure, all the members are arranged sequentially.
In a union, all members begin at the same address, making the size of the
union equal to the size of the largest member. Accessing the members of
a union is the same as accessing the members of a structure.
Union is a reserved word and union-name is the name of the union. The
variable-list, which is optional, contains the variables that have the
same data type as union-name.
•
Example
union common_area
{
char name[3];
int id;
long date;
} cdata;
Preprocessor Directives
The preprocessor directives give general instructions on how to compile the
source code. It is a simple macro processor that conceptually processes the
source codes of a C program before the compiler properly parses the source
program. In general, the Preprocessor directives do not translate directly
into executable code. It removes preprocessor command lines from the
source file and expands macro calls that occur within the source text and
adds additional information, such as the #line command, on the source file.
The Preprocessor directives begin with the # symbol. A line that begins with
a # is treated as a preprocessor command, and is followed by the name of a
command. The following are the preprocessor directives:
→
Macro substitution: #define
•
Syntax
#define
name
replaced-text
#define
name [(parameter-list)] replaced-text
HT-IDE User’s Guide
102
Содержание HT-IDE
Страница 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Страница 12: ...HT IDE User s Guide 2 ...
Страница 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Страница 24: ...HT IDE User s Guide 14 ...
Страница 70: ...HT IDE User s Guide 60 ...
Страница 76: ...HT IDE User s Guide 66 ...
Страница 92: ...HT IDE User s Guide 82 ...
Страница 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Страница 94: ...HT IDE User s Guide 84 ...
Страница 148: ...HT IDE User s Guide 138 ...
Страница 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Страница 154: ...HT IDE User s Guide 144 ...
Страница 192: ...HT IDE User s Guide 182 ...
Страница 194: ...HT IDE User s Guide 184 ...
Страница 218: ...HT IDE User s Guide 208 ...
Страница 235: ...P a r t V Appendix Part V Appendix 225 ...
Страница 236: ...HT IDE User s Guide 226 ...
Страница 250: ...HT IDE User s Guide 240 ...