The inet_pton function returns an IP address in its packed in_addr representation, i.e. ::1 becomes “. How can I convert this 16-byte value to an integer? (Well, the string representation of an integer.)
The inet_pton function returns an IP address in its packed in_addr representation, i.e. ::1
Share
The following code does it:
You can also reverse it with the following code: