C - inet_pton ============= Public domain ******************************************************************************** ### inet_pton : convert IPv4 and IPv6 addresses from text to binary form #include #include #include int main() { char *src = "83.170.42.20"; struct in_addr dst; memset(&dst, 0, sizeof dst); inet_pton(AF_INET, src, &dst); printf("Presentation = %s\n", src); printf("Network = %X\n", dst.s_addr); return 0; } ******************************************************************************** _BY: Pejman Moghadam_ _TAG: c, inet-pton_ _DATE: 2014-01-21 02:04:17_