Q:

Segmentation fault while separating tokens from a string

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main(int argc,char *argv[]) 
{
char *args[10]; 
int i=0;
char str[41], teststr[41];  //two arrays declared here
const char delimiter[2]=" ";
printf("Enter command:");
scanf("%s", str);
memcpy(teststr, str, sizeof(str));  
args[i]=strtok(teststr, delimiter); 
while(args[i]!=NULL)                
{                                   
printf("args[%d]=%s", i, args[i]); 
i++;
args[i]=strtok(teststr, delimiter);
}
return 0;
}

memcpy() is a function to copy one array to another. 
strtok() is a function to split string into tokens . 
We will loop it continuously until there are no tokens left in the string. 
Each token is stored in 'argv[]' which is a char array. 

A:

The while loop will run infinitely as the arg[i] which is first token keep on making while condition pass leading to infinite.    
Since you are using scanf() to read into string, if the string is multi word it cannot read making your code cannot parse all the tokens but only first word.  I suggest you to use fgets() as below to read multi word string,
if (fgets(str, sizeof str, stdin) == NULL) {
   ;  // handle EOF
} 

Here is the working code ideone.