Example 1
#include <stdio.h>
int main(void) {
char colors[3][8] = { "red", "green", "blue" };
char *labels[] = { "A", "B", "C" };
int i;
for (i = 0; i < 3; i++) {
printf("%s / %s\n", colors[i], labels[i]);
}
return 0;
} How It Works
colorsstores three mutable rows of up to 7 chars +\0.labelsholds pointers to string literals.- The loop prints matching pairs by index.
