How can I get the IP address of a (Linux) machine?
I found the ioctl solution problematic on os x (which is POSIX compliant so should be similiar to linux). However getifaddress() will let you do the same thing easily, it works fine for me on os x 10.5 and should be the same below. I’ve done a quick example below which will print all of … Read more