See related question/answers here:
http://stackoverflow.com/questions/1229321/sending-structure-using-recvfrom-and-sendto
Keep in mind that if the client and server have different machine architectures (Big Endian vs Little Endian) or even different compilers/interpreters then sending a raw structure is not a good idea. I have seen cases where machines of the same architecture did not view a structure layout the same because the compilers used for the client and server code had optimized the struct storage differently.
So instead of sending the whole struct, consider encoding each field into a buffer using htons(), htonl() for integers, longs, etc. Then send that buffer rather than the original struct. On the server side decode the received buffer using ntohs(), ntohl() etc.. to reconstruct the struct.
Using UDP you will have to be aware that the network may lose the message. If your client and server on on the same local LAN the chances of a lost packet are low. If the client and server are talking across the Internet then the chances go up considerably. You can add acknowledgment messages and timeouts, but then you are starting down the path of re-inventing a reliable transport like TCP (e.g. you need to handle cases where the original message made it but only the acknowledgement was lost.) Not a terrible thing to do, but just be aware of what you are getting into.
You can instead use a TCP connection and possibly keeping it open to exchange more information between client and server. In this case you will probably want to add some delimiter values between messages and "escape" those delimiters when they occur within the message buffer payloads. The reason for this is that TCP really gives you a bidirectional byte stream, so you have to be careful about where one message ends and the next begins. UDP is "message oriented" such that one recvfrom will get you one complete message, whereas with TCP when you read bytes from the socket you could be reading the tail end of one message and the first few bytes of the next message, thus the need for delimiters.