Why we can't use arrow operator in gets and puts?
#include
struct example
{
char name[20];
};
main()
{
struct example *ptr;
puts("enter name");
gets(ptr->name);/////why it does not accept this
puts(ptr->name);///it will results segmentation fault
}
With dot operator it's ok to use gets. e.g gets(s.name); but not with arrow operator please reply as soon as possible.