I was just messing around with the WinSock function 'gethostbyname'. I did this:
struct hostent *h;
char lpStringIP[20];
h = gethostbyname ("www.heartoftn.net");
sprintf (lpStringIP, "%d.%d.%d.%d", h->h_addr_list[0][0], h->h_addr_list[0][1], h->h_addr_list[0][2], h->h_addr_list[0][3]);
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: -49.65.112.11. All of it is correct except the first one. Can someone please help me?
Thanks,
Matt U.