Hey everybody!
Need some help with an issue I'm having with my code (student database)
I'm having some trouble modifying student's record and I don't understand why. Could you please have a look?
void Modifikim() //void function added to the main one
{
int select3;
char choice3;
int isFound = 0;
char IDno;
char s_id[15];
while(select3!=2){
system("cls");
printf("\n\t\t ======================================");
printf("\n\t\t | MENU: |");
printf("\n\t\t | |");
printf("\n\t\t | [1] Modify sudent's mark |");
printf("\n\t\t | [2] Back to the main menu |");
printf("\n\t\t ======================================");
printf("\n\t\t\tSelect: ");
scanf("%d", &select3);


switch(select3){
case 1:
{
system("cls");
printf("\n\t\t\t\t-MODIFY STUDENT'S MARKS-");
printf("Enter ID to Modify: ");
fflush(stdin);
gets(s_id);
fp = fopen("studentfile.txt","rb+");
while(fread(&stu, sizeof(stu),1,fp) == 1){
if(strcmp(s_id, stu.ID_no) == 0){
fflush(stdin);

for(int i=0;i