home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_12
/
1012076a
< prev
next >
Wrap
Text File
|
1992-10-13
|
551b
|
36 lines
/* token1.c: Parse input strings into tokens */
#include <stdio.h>
#include <string.h>
main()
{
char s[81], *break_set =
" \t\n\f\v\\\"~!@#$%^&*()-_=+`'[]{}|;:/?.,<>";
while (gets(s))
{
char *tokp, *sp = s;
while ((tokp = strtok(sp,break_set)) != NULL)
{
puts(tokp);
sp = NULL; /* continue in this string */
}
}
return 0;
}
Input
-----
This is 1just2a3test#.
Good-bye.
Output
------
This
is
1just2a3test
Good
bye