Please note that the follow assignement:
...will allow your system to listen in on any interface, but will egress traffic out with the lowest numbered interface.
server_addr.sin_addr.s_addr = INADDR_ANY;
But if you need to explicitely assign your IP address, then you will have to create another sin.addr construct and give it the IP in network byte order then:
Then call your sendto to use the struct with the above declaration. Please note that the sendto does have an extra struct argument that allows for this.
destination.sin_addr.s_addr = inet_addr("10.10.10.100");
/* Added sockaddr *myDestination here as an example */
sendto(int fd,const void *msg, int len, unsigned int flags, const struct sockaddr *myDestination, int tolen);