Question: Need help finishing this C programming assignment. For this homework you have a phone book. The phone book is an array of a structures containing

Need help finishing this C programming assignment.

Need help finishing this C programming assignment. For this homework you have

For this homework you have a phone book. The phone book is an array of a structures containing the names and the phone numbers of various people. Use the c library qsort to sort this phone book alphabetically. When you write your compare function do not use strcmp After you sort, clean up the phone book memory #include stdio.h> #include #include typedef structt char * pNames; int iPhoneNum; PhoneEntries; int main() int i- 0; PhoneEntries *pPhoneBook; pPhoneBook - (PhoneEntries*)malloc (sizeof (PhoneEntries)*5); pPhoneBook [0].pNames(char*)malloc(sizeof (char)*20); pPhoneBook [1].pNames(char*)malloc(sizeof (char)*20); pPhoneBook [2].pNames(char*)malloc(sizeof (char)*20); pPhoneBook [3].pNames(char*)malloc(sizeof (char)*20); pPhoneBook [4].pNames(char*)malloc(sizeof (char)*20); strcpy (pPhoneBook [0]. pNames, "Zoo Keeper"); pPhoneBook[0].iPhoneNum100; strcpy (pPhoneBook [1].pNames, "Zebra") pPhoneBook [1].iPhoneNum-200; strcpy (pPhoneBook [2].pNames, "Aardvark"); pPhoneBook [2].iPhoneNum-300; strcpy (pPhoneBook[3].pNames, "Python") pPhoneBook [3].iPhoneNum400; strcpy (pPhoneBook [4]. pNames, "Kangaroo") pPhoneBook [4].iPhoneNum500 printf("Unsorted phone book ") for(1-0 ;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!