i have a data.raw file whose contents are
4
8 register
5 fine
3 afda
4 asd

all i was supposed to do is to copy the names into a structure array here is the code i have written which is showning segmentation fault on exectution
Code:
struct extract
{
	int p_num;
	int p_len;
	char *data;
};
int main(int argc , char * argv[]){
	FILE *fp;
	int n,i;
	struct extract *e;
	fp=fopen("data.raw","r");
	fscanf(fp,"%d",&n);
	e=(struct extract*)malloc(n*sizeof(struct extract));
	e[0].p_num=n;
	for(i=1;i<=n;i++){
	fscanf(fp,"%d %s",&e[i].p_len,e[i].data);
	printf("%d %s\n",e[i].p_len,e[i].data);
	}
	
	return 0;
}