RosettaCodeData/Task/Loops-Foreach/C/loops-foreach-1.c
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

10 lines
206 B
C

#include <stdio.h>
...
const char *list[] = {"Red","Green","Blue","Black","White"};
#define LIST_SIZE (sizeof(list)/sizeof(list[0]))
int ix;
for(ix=0; ix<LIST_SIZE; ix++) {
printf("%s\n", list[ix]);
}