PDA

View Full Version : socket: can't find where is sockaddr


ravi.xolve
19-03-2008, 01:26 AM
http://pastebin.com/m42b627b9
here when I compile it gcc gives the error "cannot convert to a pointer type" for line 24. I tried to find where struct sockaddr is defined but can't find. man pages say no thing about it.

Please help.

mehulved
19-03-2008, 01:59 AM
Try sys/socket.h file. It should have your struct socketaddr defined, line 218 as per the libraries I have got.
It looks something like

struct sockaddr {
unsigned char sa_len; /* total length */
sa_family_t sa_family; /* address family */
char sa_data[14]; /* actually longer; address value */
};

ravi.xolve
19-03-2008, 02:34 AM
If You see my source here http://pastebin.com/m42b627b9 I have already included it

mehulved
19-03-2008, 03:09 AM
Try http://pastebin.com/m752c6b86
You forgot & before servaddr.