Debug assertion failed C : I'm writing a program that allows users to add a question that has 4 answers, right answer, date, author and level of complexity, also the program has functions for reading all the questions and deleting a question. When I choose the option add a question and i insert all of the characteristics the message box for the error appears it also doesn't allow me to delete or see the `.
questions. i need help


 void edit()
 {

 	char filename[2];
 	int y;
 	int q,ft,s,t, fr,d,a,l,tr,n,da;
 	FILE *f, *f1;

 	f=fopen("pff.txt","r");
 	if (f==NULL)
    {
        perror ("Error!");
    }


 	fscanf(f,"%d",&y);


    printf("           " );
 	gets(question.name);
 	n=sizeof(question.name);

    printf("Name : ");
 	gets(question.name);
 	q=sizeof(question.name);

 	printf("Answer 1: ");
 	gets(question.first);
 	ft=sizeof(question.first);

 	printf("Answer 2: ");
 	gets(question.second);
 	s=sizeof(question.second);

 	printf("Answer 3: ");
 	gets(question.third);
 	t=sizeof(question.third);

 	printf("Answer 4: ");
 	gets(question.fourth);
 	fr=sizeof(question.fourth);

 	 printf("Right answer (1-4): ");
 	scanf("%d",&question.tr);

 	printf(" ");
 	gets(question.date);
 	da=sizeof(question.date);

 	printf("Date: ");
 	gets(question.date);
 	d=sizeof(question.date);

 	printf(" Author: ");
 	gets(question.author);
 	t=sizeof(question.author);

    printf("Level (0-2): ");
 	scanf("%d",&question.level);
 	fclose (f);

 	sprintf(filename, "%d.bin", y+1);
 	puts (filename); 	f=fopen(filename,"wb");



 	fwrite(&q,sizeof(int),1,f);
 	fwrite(question.name,sizeof(question.name),1,f);
 	fwrite(&ft,sizeof(int),1,f);
 	fwrite(question.first,sizeof(question.first),1,f);
 	fwrite(&s,sizeof(int),1,f);
 	fwrite(question.second,sizeof(question.second),1,f);
 	fwrite(&t,sizeof(int),1,f);
 	fwrite(question.third,sizeof(question.third),1,f);
 	fwrite(&fr,sizeof(int),1,f);
 	fwrite(question.fourth,sizeof(question.fourth),1,f);
 	fwrite (&question.tr, sizeof (int),1,f);
 	fwrite(&d,sizeof(int),1,f);
 	fwrite(question.date, sizeof(question.date),1,f);
    fwrite(&a,sizeof(int),1,f);
 	fwrite(question.author,sizeof(question.author),1,f);
 	fwrite(question.level,sizeof(int),1,f);

    fclose(f);

 	f=fopen("pff.txt","w");
 	fprintf(f,"%d",y+1);
 	fclose(f);


 }
