Code sippet needs explaining
I have just started socket programming.
I am having trouble understanding this line of code.
I am using it like this:
bind(int socket, struct sockaddr *address, int address_length);
I can understand the 1st and 3rd parameters, but can't understand the second.
bind(s, (struct sockaddr *)&sin, sizeof(sin));
My idea is that it is passing the &sin by reference and casting it to a pointer to a struct of sockaddr.
(struct sockaddr *) &sin
Correct me if I am wrong,
Any examples would be good for me.
Many thanks for your help,