hostent address list dereferencing problem..

From: BM (b.marsh_at_gmx.net)
Date: 01/27/05


Date: 27 Jan 2005 12:46:32 -0800

Hi all,

i'm having problems grabbing the IP out of the h_addr_list (or h_addr)
sturct on a
freshly gethostbyname'd hostent structure.

observe:

struct in_addr **address;

......

if((h=gethostbyname(node)) == NULL) {
herror("gethostbyname");
exit(1);
}

address=(struct in_addr **)h->h_addr;

for(; *address != NULL; address++);
printf("addr: %s\n",*address);
exit(1);

just to purely see if I can get the address..
I am unable to get the IP...

can anyone help pls?

thanks

bm