char *command[128], buf[128]; char *s = strtok(buf, "|"); for(int i = 0; s; s = strtok(0, "|"), i++) command[i] = s;