Subject: help on inet_ntoa()
To: None <current-users@NetBSD.ORG>
From: Grzegorz Wojtowicz <grzesiek@ajax.umcs.lublin.pl>
List: current-users
Date: 07/10/1996 20:15:15
Why when i do inet_ntoa the compiler says :
: Incompatible type for argument 1 of 'inet_ntoa'
Whats wrong ??????
Here's the code :
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
main (argc , argv)
int argc;
char *argv[];
{
struct hostent *hostp;
int i;
if (( hostp = gethostbyname( argv[1] )) == NULL )
printf("Coulldnt get name %s\n", argv[1]);
else
{ printf("Host name :%s , net address : %s", hostp->h_name ,
inet_ntoa ( *(int *)hostp->h_addr ));
}
exit(0);
}
gelo.