#include<stdio.h>
#include <string.h>
/**
 * Terry Harvey CIS 105 Section 010 TA Tina Weymouth
 *  Demonstration program for strtok
 **/

int main(){

    char word[BUFSIZ];
    char * nextWordAddress;
    char word2[] = "all cats lie quietly";
    printf("enter some stuff: ");
    fgets(word, BUFSIZ, stdin);
    
    printf("input was: %s", word);

    nextWordAddress = strtok(word, " \n");
    while (nextWordAddress != NULL){
        printf("nextWA was: %s\n", nextWordAddress);
        nextWordAddress = strtok(NULL, " \n");
    }

    nextWordAddress = strtok(word2, " \n");
    while (nextWordAddress != NULL){
        printf("nextWA was: %s\n", nextWordAddress);
        nextWordAddress = strtok(NULL, " \n");
    }
    return 0;

}


