Andrea Arcangeli wrote:
> > strcpy(ipAddress,inet_ntoa(*((struct in_addr *)h->h_addr)));
> > /* ^ this line also makes an error message:
> > warning: passing arg 2 of `strcpy' makes pointer from integer
> > without a cast
> > */
>
> And infact it' s wrong. inet_ntoa() return the int 32bit IP address, not
> the poiner to the string of that address.
No, inet_ntoa does return a pointer to the string form. From the
manpage:
char *inet_ntoa(struct in_addr in);
...
The inet_ntoa() function converts the Internet host
address in given in network byte order to a string in
standard numbers-and-dots notation. The string is
returned in a statically allocated buffer, which subse
quent calls will overwrite.
The warning is due to <arpa/inet.h> not being included, so gcc thinks
that inet_ntoa() returns an `int'.
--
Glynn Clements <[EMAIL PROTECTED]>