#define ADD_BOOK_SIZE 100
#define MAX_NAME 20
#define MAX_STREET 50
#define MAX_CITY 25
#define MAX_EMAIL 30
typedef struct{
int month;
/* 1 - 12 representing month */
int day;
/* 1 - 31 representing day */
int year;
} date;
typedef struct{
char first_name[MAX_NAME + 1];
char last_name[MAX_NAME + 1];
date birthday;
char street[MAX_STREET + 1];
char city[MAX_CITY + 1];
char state[3];
/* use postal code */
int zip[9];
/* standard US zip code */
int phone[10];
/* phone numbers have 10 digits */
char email[MAX_EMAIL + 1];
} address;
1. Your job now is the write some useful functions for your address book program. The first thing you want to do is print out an address in postal code form. Here is the prototype of the function:
void print_address (address add);
Please complete the function, bearing in mind that an address written
is postal form is like the following:
Ann Smith
123 Main St.
Sunshine, FL 12345-6789
2. Now you want to filter some addresses and only print addresses for a certain state. (You are having a birthday party and want to invite your friends that live in your state). This function takes an array of addresses, the number of addresses in the array, and the state that you want to use for filtering.
Here's the prototype:
void print_address_w_state (address add[], int num, char st[3]);
3. You also included birthdays in your address book. In
order to be reminded to send your friends birthday cards, you write a function
that lists the names along with the birthdays that have a birthday in a
given month. A listing should look like this:
Charles Johnson birthday: 6/1
Ann Smith birthday: 6/20
Bob Jones birthday: 6/4
Here's the function prototype:
void print_name_birthdays (address add[], int num, int b_month);