Search code examples
windowswinapiip-address

How to get local IP address of Windows system?


Is there any code or method to get the IP addresses of the local system?


Solution

  • To enumerate local IP addresses, use the Win32 API GetAdaptersInfo() (supports IPv4 only) or GetAdaptersAddresses() (supports IPv4 and IPv6) function. C/C++ examples are included in their documentation.