Initialization of arrays

Nasza ocena:

3
Wyświetleń: 546
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Initialization of arrays - strona 1

Fragment notatki:

Initialization of arrays • An array may be initiallized - filled with provided values • Example: int days[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } • When the array size is omitted: the compiler counts initializers and sets the size to this value (12 in this example) • If there are fewer initializers than the specified size, the others will be zero • It is an error to have too many initializers • There is no way to specify more complex sequences (repetitions, single elements without specifying all of them etc.) ... zobacz całą notatkę



Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz