
November 19th, 2012, 02:09 AM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 1
Time spent in forums: 8 m 19 sec
Reputation Power: 0
|
|
|
Memory & arrays - Array problems
PLease help with with this problem T_T..This must be in C. thank you in advance
1.)Make a program that can sort a list of names and telephone numbers alphabetically. Persons are sorted alphabetically by their last names. Persons with the same last name are sorted by their first names. 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 strcmp(name1,name2) to compare two strings).
|