[Solved] If(int IDnumvariable == structname[counter].IDnumber) Not working [closed]


(form the comments)
Remove tid2= tid2 + teach[i].IDnum;.

Yes, you can use if (tid == teach[i].IDnum)

However, look at what your while(1) loop in tborrow is doing:

while(1)
   read a teacher from the file
   is the teacher the right one?
      yes - do something
      no  - print an error and recursively call tborrow again.

Think about how you would do this if you were looking for a teacher by hand in a list on paper – would you look at the first teacher in the list, then give up and start again if it wasn’t the right one?

4

solved If(int IDnumvariable == structname[counter].IDnumber) Not working [closed]