#include <string.h>
char *strtok(char *str, const char *delim);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char str[128] = {"100,101,102,103,104,105"};
int i;
char *g;
for (i = 0, g = strtok(str, ","); g != NULL; g = strtok (NULL, ","), i++)
printf ("%s\n", g);
return (0);
}
./strtok
100
101
102
103
104
105
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |