Numeric addresses for computers
Hi, I need help with writing this program.
Numeric addresses for computers on the international network Internet are composed of four parts, separated by periods, of the form:
where xx, yy, zz, and mm are positive integers. Locally, computers are usually known by a nickname as well. You are designing a program to process a list of Internet addresses, identifying all pairs of computers from the same locality. Create a structure type called address_t with components for the four integers of an Internet address and a fifth component in which to store an associated nickname of upto 10 characters. Your program should read a list of up to 100 addresses and nicknames terminated by a sentinel address of all zeros and a sentinel nickname called "none" (without the quotes).
The program should display a list of messages identifying each pair of computers from the same locality - that is, each pair of computers with matching values in the first two components of the address. In the messages, the computers should be identified by their nicknames.
Machines platte and green are on the same local network.
Include in your program a scan_address function, a print_message function, and a local_address function. The function scan_address should read in all the Internet addresses and the corresponding nicknames. Function local_address should take two address structures as input parameters and return 1 (for true) if the addresses are on the same local network, and 0 (for false) otherwise. Function print_message should display the message specifying which computers are on the same local network.