unsigned long inet_addr(const char *cp);
Converts an IPv4 address in dotted-decimal notation into a 32‑bit binary representation in network byte order. If the input string is not a valid IPv4 address, the function returns INADDR_NONE (0xFFFFFFFF).
"192.168.1.1").INADDR_NONE (0xFFFFFFFF).The returned value is suitable for use with socket functions that expect an address in network byte order. For modern applications, consider using InetPton or WSAStringToAddress for more robust parsing.
Enter an IPv4 address to see the inet_addr result: