how about strtok.

char *tokchar;
tokchar = strtok(trim_string, " ");
while(tokchar != NULL){

printf////////

tokchar = strtok(NULL, " ");
}