Mail Archives: djgpp/2000/04/14/08:52:45
I looked in the lib info, and gethostbyname isn't a DJGPP function,
though gethostname is. If this is the one, then type "info libc alpha
gethost" at the DOS prompt. It also has an exemple on how the function
is used..
HTH,
.(Trancelucid).
. Jaune .
tao_Zhou AT Shanghaigm DOT com wrote:
>
> In my program, I used the function "gethostbyname"
> by which we can get the ip address through the hostname.
> But to my surprise, it dosen't work as i expected. The way
> i used it is as followed:
> if((h=gethostbyname(hostname))==NULL)
> { herror(strerror);
> printf("%s",strerror);
> }
> Everytime when i run the program, it always told me the
> same message: unknown host.
> What's up? Who can tell me how to satisfy this awful
> function to make my program run properly?
> hungry for your help!
- Raw text -