types/array-intro-2.c - Eksplicit array initialisering - kun i erklæringer. | Lektion 9 - slide 2 : 30 Program 3 |
#include <stdio.h> #define TABLE_SIZE 11 int main(void) { /* Declaration and initialization: */ double table[TABLE_SIZE] = {0.0, 5.0, 8.0, 9.9, 10.2, 8.5, 99.9, 1.0, -5.2, 7.5, 9.4}; int i; /* Access - printing: */ for(i = 0; i < TABLE_SIZE; i++) printf("%f ", table[i]); printf("\n"); return 0; }