this
is
a
string
this
#include <stdio.h>
#include <string.h>
int main(void)
{
char string[] = "this is a string";
char *start;
start = string;
start = strtok(start, " ");
while (start != NULL) {
printf("%s\n", start);
start = strtok(NULL, " ");
}
start = string;
start = strtok(start, " ");
while (start != NULL) {
printf("%s\n", start);
start = strtok(NULL, " ");
}
return 0;
}
沒有留言:
張貼留言