【发布时间】:2016-12-07 15:19:32
【问题描述】:
这是我的代码,当我运行代码时,总是总线错误 10:
void print_tokens(char *line)
{
static char whitespace[] = " \t\f\r\v\n";
char *token;
for(token = strtok(line, whitespace);
token != NULL;
token = strtok(NULL, whitespace))
printf("Next token is %s\n", token);
}
int main(void)
{
char *line = "test test test";
print_tokens(line);
return 0;
}
请帮帮我!
【问题讨论】:
-
另外,您上面的代码在
for()行的;之前缺少)。 (很可能还有一些{、})
标签: c