[C]strtok()

2016-2-2 写技术

#include <stdio.h>
#include <string.h>

void main(){
        char str[] = "i am nicholas";
        char *ret = NULL;
        ret = strtok(str, " ");
        printf("ret:%s\n", ret);
        while(ret = strtok(NULL, " ")){
                printf("ret:%s\n", ret);
        }
}

标签: C

发表评论:

Powered by anycle 湘ICP备15001973号-1