Hi everyone...
I'm having trouble with a loop... well, I guess the problem is coming from the loop actually.
The program is compiling, but it seems like the loop is an endless one, and I don't understand why. Here's the code:
Code:
void displayInfo(EMP employee[]) {
int i=0;
int k=0;
char temp[MAXLEN];
puts("Enter employee's last name:");
scanf("%s", temp);
while (temp != employee[i].last_name)
i++;
printf("Employee ID: %d\n", employee[i].ID);
printf("Employee last name: %s\n", employee[i].last_name);
printf("Employee first name: %s\n", employee[i].first_name);
printf("Employee department: %s\n", employee[i].dept);
printf("Employee salary: $%.2f\n", employee[i].salary);
puts("What else do you want to do? ");
return;
}
I'm sure I'm doing something stupid, but it really looks good to me... If you could help me out here...