Mail Archives: djgpp/2000/04/14/04:46:49
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 -