I just got asked this question and couldn't answer it, I looked at how I've been coding it and was really confused. This is how I have been programming the accept() call in a server:
struct sockaddr_in client;
size=sizeof(client);
if(( nds=accept(ds,(struct sockaddr*)&client,&size)) <0)
{
perror("accept");
close(ds);
exit(-1);
}
Where ds is socket descriptor
I know the second parameter of accept is a pointer to the struct but don't know why it should be empty.