Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

windows equivalent of inet_aton

Tags:

c++

linux

unix

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.

like image 920
SSS Avatar asked Mar 10 '10 21:03

SSS


1 Answers

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).

like image 102
caf Avatar answered Nov 15 '22 17:11

caf