In the code below, after the scanf()
for newMIn
it skips the gets()
for newLname
. I've tried relocating it to other parts but it still skips, I've also tried using getchar()
instead of scanf()
but it still skips the next immediate function. All other variables are strings, and this function is part of a larger program.
void getINF(char *newStID, char *newLname, char *newMIn,char *newFname, char *newHomeAdd, char *newCourse, char *newMumNam,char *newPopsNam ){
printf("Input Student ID:\n");
gets(newStID);
printf("Input First Name:\n");
gets(newFname);
printf("Input Middle Initial:\n");
scanf(" %c", &newMIn);
printf("Input Last Name:\n");
gets(newLname);
printf("Input Home Address:\n");
gets(newHomeAdd);
printf("Input Course:\n");
gets(newCourse);
printf("Input Name of Mother:\n");
gets(newMumNam);
printf("Input Name of Father:\n");
gets(newPopsNam);
printf("\n\n%s\n",newStID);
printf("%s\n",newFname);
printf("%c\n",newMIn);
printf("%s\n",newLname);
printf("%s\n",newHomeAdd);
printf("%s\n",newMumNam);
printf("%s\n",newPopsNam);
printf("%s\n",newCourse);
return;
}