title: Negative Numbers over TCP socket C
body: <p>Whenever I try to send a negative number over a TCP socket, when I print what was received,it reads "4.29497e+09". All I'm doing is this:</p>
  
  <pre><code>int i = -8;
  int temp = htonl(i);
  write(sock,&amp;temp,4);
  </code></pre>
  
  <p>On the Server:</p>
  
  <pre><code>int temp;
  read(sock, &amp;temp,4);
  int read = ntohl(temp);
  cout &lt;&lt; read &lt;&lt; endl;
  </code></pre>
  
  <p>If anyone could help, it would be much appreciated.</p>