07.06.2012, 19:39
|
#15
|
|
Ответ: Вопрос-Ответ
http://ideone.com/ttYDS
/* strtok example */
#include <stdio.h>
#include <string.h>
int main ()
{
char str[] ="man{0,1,2,3}\nmanman";
char * pch;
printf ("Splitting string \"%s\" into tokens:\n",str);
pch = strtok (str,"{},\n");
while (pch != NULL)
{
printf ("%s\n",pch);
pch = strtok (NULL, "{},\n");
}
return 0;
}
|
|
|
|