An aggregate type is an array, class, or structure type which:
Initializers for aggregates can be specified as a comma-separated list of values enclosed in curly braces. For example, this code declares an int array of 10 and initializes it:
int rgiArray[10] = { 9, 8, 4, 6, 5, 6, 3, 5, 6, 11 };
The initializers are stored in the array elements in increasing subscript order. Therefore, rgiArray[0]
is 9, rgiArray[1]
is 8, and so on, until rgiArray[9]
, which is 11. To initialize a structure, use code such as:
struct RCPrompt
{
short nRow;
short nCol;
char *szPrompt;
};
RCPrompt rcContinueYN = { 24, 0, "Continue (Y/N?)" };