| coding-style/variabel-navne/all-caps.c - All caps - som et eksempel på at små/store bogstaver kan bruges til at signalere rollen af navne. | Lektion 6 - slide 17 : 21 Program 6 |
#include <stdio.h>
/* Names of constants defined as macroes are ALL CAPS */
#define TABLE_SIZE 11
int main(void) {
/* Declaration: */
double table[TABLE_SIZE];
int i;
/* Initialization: */
for(i = 0; i < TABLE_SIZE; i++)
table[i] = (double)(2 * i);
/* Printing: */
for(i = 0; i < TABLE_SIZE; i++)
printf("%f\n", table[i]);
printf("\n");
return 0;
}