I have the next code:
char str[] = "%fds%f%dssa%sss"; char* tokenStr = strtok(buffer, "%"); while (tokenStr != NULL) {