char * smtpIp(char * url)
{
HOSTENT * iphost;
char ipconfig[20];
if((iphost = gethostbyname(url)) != NULL)
{
int i = 0;
while(iphost->h_addr_list[i])
{
char ip[20];
memcpy(&ip, inet_ntoa(*((struct in_addr *)iphost->h_addr_list[i])), 20);
printf("%s", ip);
memset(ip, ‘\0‘, 20);
i++;
}
}
}
时间: 2024-10-10 07:12:27