typedef struct employee
{
int age;
char name[30];
} emp_t;
emp_t * e;
int main( )
{
printf("\nName : ");
scanf("%s", &e->name);
return 0;
}
this code compiles but when I try to enter my name such as "mukesh" it throughs out an error Can somebody explain why this is happening In the structure I used char name[] as well as char * name......did't work I don't understand why???????
do I need to allocate memory dynamically to the structure employee and then assign it it to e->name