”@

Home 

c++ Programming Glossary: ifa

Get the IP address of the machine

http://stackoverflow.com/questions/212528/get-the-ip-address-of-the-machine

compliant so should be similiar to linux . However getifaddress will let you do the same thing easily it works fine for.. of the machine's IPv4 address you should also check the getifaddrs was successful ie returns 0 . I've updated it show IPv6.. too. #include stdio.h #include sys types.h #include ifaddrs.h #include netinet in.h #include string.h #include arpa..

Obtaining local IP address using getaddrinfo() C function?

http://stackoverflow.com/questions/2146191/obtaining-local-ip-address-using-getaddrinfo-c-function

obtain the local IP address es the function you want is getifaddrs here's a minimal example #include stdio.h #include stdlib.h.. in.h #include arpa inet.h #include net if.h #include ifaddrs.h #include errno.h int main int argc char argv struct ifaddrs.. #include errno.h int main int argc char argv struct ifaddrs myaddrs ifa void in_addr char buf 64 if getifaddrs myaddrs..