wasife wrote:
ULONG ip=inet_addr(*(localhost->h_addr_list)); in_addr localaddr; localaddr.S_un.S_addr=ip; char* localIP=inet_ntoa(localaddr);
replace ur code above with line below: char* localIP=inet_ntoa(*(LPIN_ADDR)*(localhost->h_addr_list)); It should be work, but I can't tell why ur code doesn't. wish this could help!