>struct sockaddr_in sockaddr;
>When my client goes to connect, the call is like this:
>if ( connect ( s, &sockaddr, sizeof(sockaddr)) < 0 )
>When I compile it I get a warning about incompatible pointer types. I
>get this message at just about every place where I use the address-of
>(&) operator. Does Linux have trouble with the & operator, and if so,
>how does one solve this? If there's a group especially for programming
interface has been designed in an OO manner where struct sockaddr is the
most basic socket type and struct sockaddr_in is the inet extension to
Thus struct sockaddr is a super type of struct sockaddr_in and you may safely
cast the pointers.
In plain english:
if (connect (s, (struct sockaddr *) &sockaddr, sizeof (sockaddr)) < 0)
will remove the warning.