Although the below code is working fine.But its showing "segmentation fault" when i am trying to accept the strings using fgets as i want to store strings which might contain spaces.How to accept strings (which might contain spaces) in character pointer array
int main(){
char* nm[5];
char* st;
for(int i=0;i<5;i++)
//fgets(nm[i],30,stdin);
scanf("%ms",&nm[i]);
for(int i=0;i<5;i++)
printf("%s\n",nm[i]);
return 0;
}