I have a struct for employees, id, age and salary. I need the user to select what employee they would like to edit by typing their user ID. I need to use a do-while to search through the struct until the user enters a valid user ID.
So far I've got:
SIZE = 4
case 3: //Updating Employee Salary
printf("Update Employee Salary\n");
printf("======================\n");
do {
printf("Enter Employee ID: ");
scanf("%d", &salaryEmpChoice);
} while (salaryEmpChoice != emp[0 - SIZE].id) ;
break;
For the while part, I've tried [0 - SIZE], [0, 1, 2, 3], but it only works when I put in one value only at a time i.e. [0] instead of all 4 elements.