#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 3
int main(){
const char* sep ="@.";
char email[] ="zhangpengwei@bitejiuyeke.com";
char cp[30] = {};//"zhangpengwei@bitejiuyeke.com"strcpy(cp,email);
char* ret = strtok(email, sep);
printf("%s\n", ret);
ret = strtok(NULL, sep);
printf("%s\n", ret);
ret = strtok(NULL, sep);
printf("%s\n", ret);
return 0;
}
切割字符串strtok函数
最新推荐文章于 2024-10-30 16:47:45 发布