#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
char buf[] = "a:bb:ccc";
const char s[2] = ":";
char *token = NULL;
token = strtok(buf, s);
while (token != NULL)
{
printf("%s\n", token);
token = strtok(NULL, s);
}
return 0;
}
Linux c strtok分割字符串
最新推荐文章于 2024-11-26 18:20:21 发布