I want to make codes which are scanning the words and print them by using a pointer array so I made this code. But when I implement it makes core dumped. Why this code make core dumped and how to fix it? Am I wrong to make code?
Then please explain to me thanks for reading my question.
#include <stdio.h>
#include <string.h>
int main(void)
{
char*pch[5];
int i;
for(i=0; i<5; i++)
{
printf("enter word: ");
scanf("%s", pch[i]);
}
for(i=0; i<5; i++)
{
printf("%s\n", pch[i]);
}
return 0;
}