title: Sending string over UDP in C++
body: <p>I would like to send a string: <code>"Jane Doe"</code> to intranet ip <code>192.168.0.4</code> to port <code>9000</code> over UDP. I have done this many times via UDP and TCP by Java, but now I have to do it with standard C++ libraries and I can't find any samples only topics where people just can't make it work.</p>
  
  <p>I know that I have to encode <code>"Jane Doe"</code> as array of bytes then just open socket, pack it in datagram and send it. </p>
  
  <p>C++ is not my first language and this is small part of code I can't figure out, I've chosen UDP because it is always much simpler than TCP.</p>