02/21/00
COM1100 Winter2000 Yuhong Yin
12
Array initialization
--1
n
Array can be declared and initialized at the same
time.
n
Examples
n
int grades[6] = { 98, 87, 63, 74, 86, 76};
n
Size is 6
n
char codes[4] = { ‘F’, ‘S’, ‘C’, ’D’};
n
Size is 4
n
double temp[4] ={ 10.9, 54.8, 34.5, 42.1};
n
Size is 4
n