GetAdaptersAddresses
function can retrieve information for IPv4 and IPv6 addresses. It is part of Windows API. The example code and the documentation can be found at https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses