头文件:#include <string.h>
定义函数:char * strtok(char *str, const char *delimiters);
函数功能:
切割字符串,将str切分成一个个子串
函数参数:
str:在第一次被调用的时间str是传入需要被切割字符串的首地址;在后面调用的时间传入NULL。
delimiters:表示切割字符串(字符串中每个字符都会 当作分割符)。
函数返回值:
当s中的字符查找到末尾时,返回NULL;
如果查不到delimiter所标示的字符,则返回当前strtok的字符串的指针。
范例
#include <stdio.h>
#include <string.h>
int main(void)
{
char buf[] = "come@on@boys";
char *temp = strtok(buf,"