69,369
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void print_tokens(char *line)
{
static char whitespace[] = " \t\f\r\v\n";
printf("%s\n", line);
char *token;
for ( token = strtok(line, " "); token != NULL;
token = strtok(NULL, whitespace) )
printf("%s\n", token);
}
int main()
{
char input[] = "aa bb cc dddd fsd123 134 fwe";
print_tokens(input);//如果把这里的input换成"aa bb cc dddd fsd123 134 fwe"程序就会崩溃
return 0;
}