I am unable to print an array of strings after taking them as input from user.
int main()
{
char name[3][10];
for (int i=0;i<3;i++)
{ printf("name:\n");
scanf("%9[^\n]",&name[i][0]);
}
for (int i=0;i<3;i++)
printf("%s\n",&name[i][0]);
}
Although this works perfectly fine (without the loop)
int main()
{
char name[2][10];
printf("enter the name");
scanf("%9[^\n]",&name[0][0]);
printf("%s",&name[0][0]);
}
Please help me as to where am I mistaken.