hostname 잡아 오는거...
글쓴이: 익명 사용자 / 작성시간: 목, 2002/03/07 - 8:24오후
AIX 4.3.3 에서 gcc 2.95 를 이용해서 호스트 네임을 잡아오는 것을 만들
었는데 호스트 네임을 잡질 못합니다.
소스를 보면..
=============================================
#include
#include
main ()
{
struct hostent* hoststruct;
char hostname[255];
gethostname(hostname, 100);
hoststruct = gethostbyname(hostname);
printf("this hostname is %s\n", hoststruct);
}
=============================================
컴파일은 되는데 실행을하면
this hostname is
이렇게만 나옵니다..
좀 가르쳐 주세요..
Forums:
s/hoststruct);/hoststruct->h_name);/
printf("this hostname is %s\n", hoststruct->h_name);
댓글 달기