#include
#include
int main ()
{
char str[] ="- This, a sample string.";
char * pch;
int count = 4;
printf ("Splitting string \"%s\" into tokens:\n",str);
while(count--)
{
pch = strtok (str," ,.-");
while (pch != NULL)
{
printf ("%s\n",pch);
pch = strtok (NULL, " ,.-");
}
}
}
왜 다음과 같이 실행하면 this a sample string 이렇게 4번씩 출력되야 되는게 맞다고 생각되는데 왜 안될까요..?