Possible Duplicate:
IP Address to Integer - C
How do I convert an IP address to integer which has the following form: A.B.. or A.B.C.* or A...* or ... I want to write a C program which can determine if an IP address is a subset of another. e.g the IP address 192.168.125.5 is a subset of 192.168... Now I want to convert both the IP addresses to unique integers and subsequently check if one is a subset of the other. Is there a way to achieve this?