Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Separar por Tokens con strtok A.Villanueva
- * char *strtok(char *str, const char *delim)
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main() {
- char * token;
- char str[] = "- Alguien volo,sobre el nido del cuco. -";
- const char * sep = " ,.-!";//Separadores
- token = strtok ( str, sep );//Primer token
- while( token != NULL ) {//Recorro los tokens
- printf( " %s\n", token );
- token = strtok(NULL, sep);
- }
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement