SSS SSS - 1 year ago 417
Linux Question

windows equivalent of inet_aton

I'm converting some code written for a linux system to a windows system. I'm using C++ for my windows system and wanted to know the equivalent of the function inet_aton.

caf caf
Answer Source

Windows supports inet_pton, which has a similar interface to inet_aton (but that works with IPV6 addresses too). Just supply AF_INET as the first parameter, and it will otherwise work like inet_aton.

(If you can change the Linux source, inet_pton will also work there).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download