fig1.c 376 B

123456789101112131415
  1. #include<stdio.h>
  2. #include<stddef.h>
  3. // Compile with `gcc -Wall -pedantic -ansi -std=c99 fig1.c`
  4. int main() {
  5. // Define an array of strings
  6. char myStrings[][10] = {"one", "two", "three", "four", "five"};
  7. // Print strings in array, from 0 -> |length of myStrings (4)|
  8. size_t i = 0;
  9. for (i = 0; i < 5; i++) {
  10. printf("%s\n", myStrings[i]);
  11. }
  12. }