title: How do I send an array of integers over TCP in C?
body: <p>I'm lead to believe that <code>write()</code> can only send data buffers of byte (i.e. signed char), so how do I send an array of long integers using the C <code>write()</code> function in the sys/socket.h library?</p>
  <p>Obviously I can't just cast or convert long to char, as any numbers over 127 would be malformed.</p>
  <p>I took a look at the question, <a href="https://stackoverflow.com/questions/392371/how-to-decompose-integer-array-to-a-byte-array-pixel-codings">how to decompose integer array to a byte array (pixel codings)</a>, but couldn't understand it - please could someone dumb it down a little if this is what I'm looking for?</p>
  <h3>Follow up question:</h3>
  <p><a href="https://stackoverflow.com/questions/673799/why-do-i-get-weird-results-when-reading-an-array-of-integers-from-a-tcp-socket">Why do I get weird results when reading an array of integers from a TCP socket?</a></p>