in my c program i try the following :
struct hostent *hptr,*htmp; char** pptr = NULL; char addr[INET6_ADDRSTRLEN]; int i = 1,flag; //struct in_addr addr;