home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / tyc / list15_6.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-16  |  439 b   |  22 lines

  1.  /* Passing an array of pointers to a function. */
  2.  
  3.  #include <stdio.h>
  4.  
  5.  void print_strings(char *p[], int n);
  6.  
  7.  main()
  8.  {
  9.      char *message[8] = { "Four", "score", "and", "seven",
  10.                      "years", "ago,", "our", "forefathers" };
  11.  
  12.      print_strings(message, 8);
  13.  }
  14.  
  15.  void print_strings(char *p[], int n)
  16.  {
  17.      int count;
  18.  
  19.      for (count = 0; count < n; count++)
  20.          printf("%s ", p[count]);
  21.  }
  22.