hostent address list dereferencing problem..
From: BM (b.marsh_at_gmx.net)
Date: 01/27/05
- Next message: Fletcher Glenn: "Re: hostent address list dereferencing problem.."
- Previous message: Billy Patton: "how to staticalll bin libstdc++*"
- Next in thread: Fletcher Glenn: "Re: hostent address list dereferencing problem.."
- Reply: Fletcher Glenn: "Re: hostent address list dereferencing problem.."
- Reply: Jens.Toerring_at_physik.fu-berlin.de: "Re: hostent address list dereferencing problem.."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Fletcher Glenn: "Re: hostent address list dereferencing problem.."
- Previous message: Billy Patton: "how to staticalll bin libstdc++*"
- Next in thread: Fletcher Glenn: "Re: hostent address list dereferencing problem.."
- Reply: Fletcher Glenn: "Re: hostent address list dereferencing problem.."
- Reply: Jens.Toerring_at_physik.fu-berlin.de: "Re: hostent address list dereferencing problem.."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]