title: How to send/receive array of strings on a socket in C
body: <p>I am trying to send an array of strings over a socket and receive it on the other end.</p>
  
  <p><strong>Here is my client side ( side sending the data ) :</strong></p>
  
  <pre><code>char* client_hello[] =
  {
    "Type             client_hello",
    "Version          SSLv3.0",
    "Session ID       1",
    "Random           1as2@3%$h&amp;KF(*)JAGG&amp;(@H%A$D@J*@@",
    "Cipher-Suites    TLS_RSA_WITH_RC4_128_SHA",
    "Compression      null(0)"
  };
  
  SendBytes = send(sock, client_hello, 6, 0);
  </code></pre>
  
  <p><strong>This is my Server side ( side receiving the data )</strong>:</p>
  
  <pre><code>int inMsgLen = recvfrom(clntSock, inMsg, 1024, 0,(struct sockaddr *)&amp;clntAddr, (socklen_t*)&amp;clntAddrLen);
  
      if (inMsgLen &lt; 0) {
          //printf("Error in recvfrom() errno=%d\n", errno);
          continue;//exit(1);
      }else if (inMsgLen &gt; 1024) {
          printf("Received message too long (size=%d)\n", inMsgLen);
          exit(1);
      }else{
          printf("Received Message: %s\n", inMsg);
      }
  </code></pre>
  
  <p><code>inMsg</code> is declared as <code>char inMsg[1024];</code></p>
  
  <p>This is what the output is on the server side :</p>
  
  <pre><code>Received Message: +?
  </code></pre>
  
  <p>What am I doing wrong ? How can I send/receive the entire client_hello array ?</p>