strcmp and scanf (for phonebook program)

My assignment calls for a program that uses structures for phonebook entries with first name, last name, and number (7 digit, no characters).
typedef struct
{
char first[80];
char last[80];
int number;
}entry;

The entries should be sorted by last name, but searchable by last name or phone number. Adding the entry isn't much of a problem, but I am having a hard time wrapping my head around how to use strcmp to differentiate between searching by last name or searching by number.
Topic archived. No new replies allowed.