home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
d
/
dec92.zip
/
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