The sendto() call may be used only when the socket is in a connected state (so that the intended recipient is known). Following is the prototype of write function and it has 3 parameters not 5 like send() function.
write(int fd, const void *buf, size_t count);