title: passing a struct over TCP (SOCK_STREAM) socket in C
body: <p>I have a small client server application in which i wish to send an entire structure over a TCP socket in C not C++. Assume the struct to be the following:</p>
  
  <pre><code>    struct something{
  int a;
  char b[64];
  float c;
  }
  </code></pre>
  
  <p>I have found many posts saying that i need to use pragma pack or to serialize the data before sending and recieveing.</p>
  
  <p>My question is, is it enough to use JUST pragma pack or just serialzation ? Or do i need to use both?</p>
  
  <p>Also since serialzation is processor intensive process this makes your performance fall drastically, so what is the best way to serialize a struct WITHOUT using an external library(i would love a sample code/algo)?</p>