Hi all.
I want to obtain the IP address and MAC address of the local NIC. How to write the code in C? or any header file and library can be used?
Thanks.
Printable View
Hi all.
I want to obtain the IP address and MAC address of the local NIC. How to write the code in C? or any header file and library can be used?
Thanks.
getaddrinfo or gethostbyname on the local host (obtained by gethostname) should return all the IP addresses of the local host (127.0.0.1 and another).
thank you. Which header file or library support "getaddrinfo"?
I am using Mingw 3.4.2 (Dev-C++). Thanks.
gethostbyname doesn't always work. If you want the sure-fire way to do it, look at the code for ifconfig in BusyBox.Quote:
Originally Posted by Dweia