Question is really simple.
I need a tool to convert char*
to ip adress and use it in
sockaddr_in.s_addr
arpa/inet.h has inet_addr()
function, but I am not sure if I already have this file somewhere in MS VS 2010 installation or should I get it elsewhere.
The arpa/inet. h header file contains definitions for internet operations.
arpa/inet. h is the include used on Unix-like systems. On Windows, you must use winsock2. h .
Win32 provides its own implementation of the sockets API (Winsock) which uses slightly different headers.
From the MSDN for inet_addr
:
Header Winsock2.h
arpa/inet.h
is the include used on Unix-like systems.
On Windows, you must use winsock2.h
.
Example from the MSDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With