String Manipulation/Lab6.c
void parseSentence(char *S){
    
    char *strTokenPtr;
    char strCopy[strlen(S)];
    
    strcpy(strCopy, S); //creates a copy of data to avoid data destruction
    
    //loops until NULL terminating char is found. Tokenize each word until then
    strTokenPtr = strtok(strCopy, " ,;.");
    while(strTokenPtr != NULL){
        printf("%s\n", strTokenPtr);
        strTokenPtr = strtok(NULL, " ,;.");
    }
}
/*
    parseSentense: tokenizes a sentence and prints each word individually
    input: a null terminating string (S)
*/
tokenizes a sentence and prints each word individually
input: a null terminating string (S)
tokenizes a sentence and prints each word individually input : a null terminating string ( S )
void parseSentence(char *S){
    char *strTokenPtr;
    char strCopy[strlen(S)];
    strcpy(strCopy, S); 
    strTokenPtr = strtok(strCopy, " ,;.");
    while(strTokenPtr != NULL){
        printf("%s\n", strTokenPtr);
        strTokenPtr = strtok(NULL, " ,;.");
    }
}
void parseSentence ( char * S ) { char * strTokenPtr ; char strCopy [ strlen ( S ) ] ; strcpy ( strCopy , S ) ; strTokenPtr = strtok ( strCopy , " " ) ; while ( strTokenPtr != NULL ) { printf ( " \n " , strTokenPtr ) ; strTokenPtr = strtok ( NULL , " " ) ; } }
parseSentense: tokenizes a sentence and prints each word individually
input: a null terminating string (S)
parseSentense : tokenizes a sentence and prints each word individually input : a null terminating string ( S )
//creates a copy of data to avoid data destruction //loops until NULL terminating char is found. Tokenize each word until then