So I was doing an assignment for a class in which I have to perform basic array functions for an array of structures and in taking input my program closed on its own. The program terminated after taking input of name
void input(struct record *d){
printf("\nenter name: ");
fflush(stdin);
gets(d->name);
printf("\nenter adress: ");
fflush(stdin);
gets(d->adress);
printf("\nEnter mobile no :");
scanf("%s",d->mobile);
printf("\nenter marks:");
scanf("%if",d->marks);
printf("\nenter cgpa: ");
scanf("%if",d->cgp);
}
The record structure must be initialized, and you should use