WinSock and gethostbyname() won't return correctly...
I was just messing around with the WinSock function 'gethostbyname'. I did this:
struct hostent *h;
h = gethostbyname ("www.heartoftn.net");
sprintf (lpStringIP, "%d.%d.%d.%d", h->h_addr_list, h->h_addr_list, h->h_addr_list, h->h_addr_list);
but whenever one of the "blocks" of the IP address is 200+, it returns as a negative number. With the heartoftn.net (my ISP) the first part is supposed to be 207, but it returns as: -22.214.171.124. All of it is correct except the first one. Can someone please help me?