Skip to content

Instantly share code, notes, and snippets.

@vadimtsushko
Created November 2, 2012 11:37
Show Gist options
  • Save vadimtsushko/4000567 to your computer and use it in GitHub Desktop.
Save vadimtsushko/4000567 to your computer and use it in GitHub Desktop.
Болванка по задачке
#include <stdio.h>
#include <string.h>
int main ()
{
char str[] ="- This, a sample string. word1with";
char digits[] = "0123456789";
char * pch;
printf ("Splitting string \"%s\" into tokens:\n",str);
pch = strtok (str," ,.-");
while (pch != NULL)
{
char * testDigit = strpbrk(pch,digits);
if (testDigit != NULL) {
printf ("%s\n",pch);
}
pch = strtok(NULL, " ,.-");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment