Hi All,
Below mentioned code gives the segmentation fault when I executed,
please help me, what is the wrong with my code.
Below mentioned code gives the segmentation fault when I executed,
please help me, what is the wrong with my code.
Code:
#include <stdlib.h>
#include <stdio.h>
struct student
{
char *name;
char *place;
};
main()
{
struct student *tmp;
(tmp->name) = (char *)malloc(90);
(tmp->place) = (char *)malloc(90);
printf("%d\n",sizeof(tmp->name));
}
Comment