
→
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
Summary of Contents for HT-IDE
Page 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Page 12: ...HT IDE User s Guide 2 ...
Page 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Page 24: ...HT IDE User s Guide 14 ...
Page 70: ...HT IDE User s Guide 60 ...
Page 76: ...HT IDE User s Guide 66 ...
Page 92: ...HT IDE User s Guide 82 ...
Page 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Page 94: ...HT IDE User s Guide 84 ...
Page 148: ...HT IDE User s Guide 138 ...
Page 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Page 154: ...HT IDE User s Guide 144 ...
Page 192: ...HT IDE User s Guide 182 ...
Page 194: ...HT IDE User s Guide 184 ...
Page 218: ...HT IDE User s Guide 208 ...
Page 235: ...P a r t V Appendix Part V Appendix 225 ...
Page 236: ...HT IDE User s Guide 226 ...
Page 250: ...HT IDE User s Guide 240 ...