Get IP-address by URL
问题 This works target.sin_addr.s_addr = inet_addr("127.0.0.1"); but I want to put the IP from a website URL I have tried const char host[] = "http://www.google.com/"; struct hostent *host_ip; host_ip = gethostbyaddr(host, strlen(host), 0); I of corse did WSAStartup before I used gethostbyaddr(); I've tried this target.sin_addr.s_addr = inet_addr(host_ip); I've tried a few simmilar ones too but it isn't working. Could someone show me how to do this correctly. Thank you! EDIT: When I do host_ip =