A program that can sort a list of names and telephone numbers alphabetically. Persons are sorted alphabetically by their first names. Persons with the same first name are sorted by their last names.
Following are the guidelines for program,program must include these things.
Input: names and telephone numbers,
Output: list of names and telephone numbers ordered alphabetically.
Define a structure named person that contains a person's first name, last name, and telephone number.
Define a function that compares two structures of type person according to the following prototype:
int compare(person * a, person * b);
This function should return a negative value if person a comes before b, and a positive value if b comes before a. (You may use the function stricmp(name1,name2) to compare two strings).
Define a function that swaps the contents of two structures of type person:
void swap(person * x, person * y);