C Program to convert IP address to 32-bit long int

An IPv4 address is displayed as four decimal octets separated by dots (e.g., 192.168.1.1) but is stored internally as a single 32-bit unsigned integer. Converting between the dotted-decimal string and the integer form is a fundamental networking operation — inet_addr() in the POSIX socket API does exactly this. Understanding how to do it manually shows …