/* pvector.c parse a line of string, then insert each word to an array of pointer Written by Jose Mari Reyes Copyright(C)1999, Jose Mari Reyes July 31, 1999, manila philippines jet_reyes@jetemail.net www.angelfire.com/co2/xtechnica */ #include void parse_vector(char **args, char *buf) { while (*buf != '\0') { while ((*buf == 0x20 ) || (*buf == '\t')) *buf++ = '\0'; *args++ = buf; while ((*buf != '\0') && (*buf != 0x20) && (*buf != '\t')) buf++; } *args='\0'; } void main() { char buf[] = "run jet master 1 2 3 comeon h 678"; char *args[64]; int i = 0; parse_vector(args, buf); while (args[i] != NULL) { printf("\n%d...%s", i, args[i]);getchar(); i++; } }