int j = 1; //Store the program name for execution cmd_hldr = strtok(cmd_ary[i], delimiter); cmd_to_fork[0] = cmd_hldr; //Store the arguments for the program while (( cmd_hldr = strtok(NULL, delimiter)) != NULL) { cmd_to_fork[j]=cmd_hldr; fprintf(stderr,"Arg %d of command [%s] is [%s] MAIN\n", j, cmd_to_fork[j]\ , cmd_to_fork[j]); j++; }