/* Peter Cline -- July 16
   Playing with character pointers
*/

#include <stdio.h>
#include <string.h>

int main() {

  char s1[30] = "Sat, July 16, 2007";
  
  char weekday[20];
  char day[20];
  char month[20];
  char year[20];



  char *cptr = NULL;

  cptr = strtok(s1, ", ");
  strcpy(weekday, cptr);
  //  printf("%s\n", cptr);

  cptr = strtok(NULL, ", ");
  strcpy(month, cptr);
  //printf("%s\n", cptr);

  cptr = strtok(NULL, ", ");
  strcpy(day, cptr);
  //printf("%s\n", cptr);

  cptr = strtok(NULL, ", ");
  strcpy(year, cptr);
  //printf("%s\n", cptr);

  printf("Today is the %sth of %s %s, which is a %sday\n",
	 day, month, year, weekday);

  return 0;
}
