|
I would like to ask how to get the local IP address in the form of IPv6, I have already installed IPv6.
I wrote some, but it's definitely wrong, please help me change it.
char hostname [128] = {0};
struct hostent * inaddrs;
string m_strSourceAddr;
if (gethostname (hostname, 128) == 0)
{
inaddrs = gethostbyname (hostname);
}
m_strSourceAddr = inaddrs-> h_addr_list [0]; |
|