C++ split

来源:互联网 发布:金贵洗浴软件 编辑:程序博客网 时间:2024/06/08 18:23
void split(char *src,  char *separator, char **dest){char *pNext;int count = 0; if (src == NULL || strlen(src) == 0) return;if (separator == NULL || strlen(separator) == 0) return;  pNext = strtok(src,separator); while(pNext != NULL){*dest++ = pNext;++count;pNext = strtok(NULL,separator);} }
原创粉丝点击