I'm having an issue with an if/else or maybe just the boolean conditions for it but I'm really stuck. But what my problem is that The print statement "There is no record matching etc..." is being called when it shouldn't so I would assume that 1 is being added t the count in the else if where it shouldn't if the employee muber is found. If feel like I muddled that whole sentence, but I'm not sure how else to explain it. Any help would be great.
if(FindNumber == expenses[i].emp_num)
//prompt user for input from menu to choose field to update
printf("\nWhat would you like to update?");
printf("\nDistance Traveled\t- D or d\nMileage Rate\t\t- R or r\nMeal Costs\t\t- M or m\nQuit to Main Menu\t- Q or q");
scanf("%c", &update);//assign user choice to variable update
//switch to case based on the variable update as defined by the user
//ommited for space
else if(FindNumber!=expenses[i].emp_num)//if input employee number does not match any record
++count;//add one to count
if (count==i+1)//if count equals i+1
printf("\nThere is no record matching that employee number in the database.\n");
Is this code within a for-loop? If yes, then once you find the matching employee number, you should break out of the for-loop. Otherwise, count will get incremented multiple times.