ID Number: Q75602
4.x 5.00 5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a
MS-DOS | OS/2
Summary:
The code fragment below demonstrates initialization of an array of
structures within a Microsoft C or Microsoft QuickC program. Each
element is grouped within brackets, and elements are separated by
commas. The initialization of the array rgttype shows how to
initialize a structure within a structure within an array of
structures.
Sample Code
-----------
/* Compile options needed: none
*/
struct stype {
int a;
int b;
int c;
};
struct ttype {
int alpha;
struct stype beta;
};
/* a, b, c */
struct stype rgstype[2] = { {8, 9, 10}, \
{15, 16, 17} };
/* alpha beta */
struct ttype rgttype[2] = { {{1}, {2,3,4}}, \
{{5}, {6,7,8}} };
Additional reference words: 1.00 1.0 1.01 2.00 2.0 2.01 2.50 2.5 2.51
3.0 4.00 5.00 6.00 5.1 7.00