Hello everyone. I am having a trouble with storing first and last names into the string, the program stops after it asks to type the first name in.
here is the function
I do no see why it stops. I will be very ppriciated if anyone can point where I am wrong.
struct student get_student_number_and_name(struct student X[MAX], int y)
int i, valid, num;
for(i=1; i<=y; ++i)
printf("\n\nEnter student %i - # ", i);
printf("First name: ");
scanf_s("%s", X[i].first_name); //it stops here.
printf("Last name: ");
printf("Student Number has been entered! Try agin!");