An array of strings problem
Ok so basically I'm having a problem creating an array of strings, I've attempted to define it as a pointer to character arrays of size twenty. But i dont know if scanf will read in a string to a character array or just the first character. I have a feeling i'm not going about it the right way, I can get it to read in, but when it moves on to printing out the data i've read in, it fails.
Code:
int n,m;
char (*x)[20];
int main()
{
printf("Please say how many names you will enter:");
scanf("%d", &n);
for(m=0; m<n; m++)
{
printf("\nName %d: ",(m+1));
scanf("%s", &x);
}
for(m=0; m<n; m++)
{
printf("\nName %d: %", (m+1), (x+m));
}
return 0;
}
Any suggestions or direction would be greatly appreciated