I am studying the C language.
When I pass a pointer to gets(), I find it can work well.
char *ptr;
gets(ptr);
puts(ptr);
But if I define an array of pointers, it doesn't work.
char *ptr[4];
int i=0;
for(i=0;i<4;++i)
gets(ptr[i]);
for(i=0;i<4;++i)
puts(ptr[i]);
Are they different, or is the first part wrong in fact? I want to know the reason.