I want to create a string array where user will give the input and data will be stored in array..I have no clue how to do that-(I read several C books) Any help ll be appreciated What I tried so far:
int choice;
printf("enter the number of the strings: ");
scanf("%d",&choice);
char **str=(char **)malloc(100);
int i;
for(i=0;i<choice;i++)
{
printf("enter %dth element ",i+1);
str[i]=(char *)malloc(10);
scanf("%s",str[i]);
}
printf("%s",str[0]);