You should have
since array[loop] is not a pointer, it is the value of the actual element, thus *(array+loop)
memcpy(array + loop, cmd_str + i , j);
Haven't checked if the logic is correct
But do not use memcpy for this.
I am sure you will get a lot "don't use gets()" comments so just go ahead and change it to fgets(). See the forums FAQ or google fgets().
But in any case, I will show you how to use strtok(). You use it always similar (passing the string on the first call and NULL on the second) usually:
this is the example used here. It is the basic use.
tok = strtok(cmd_str, " "); //you pass your string and the delimiter, which is space for u
while(tok != NULL)
printf("%s\n", tok); //you print your token, one every line
tok = strtok(NULL, " "); //you pass NULL now to continue on the rest of the string!