title: How can I initialize an array of pointers pointing to a struct?
body: <p>I have the following struct:</p>
  
  <pre><code>struct clientDetails 
  {
      int socket;  
      char* port;
      char* IP;
      char* hostName;
      int msgSentCount;
      int msgRecvCount;
      char* status;
      char bufferMsg[BUFFER_SIZE];
      char blockedUser[4];
      int blockedCount;   
  };
  </code></pre>
  
  <p>And I have an array of pointers:</p>
  
  <pre><code>struct clientDetails* allClients[4];
  </code></pre>
  
  <p>How can I initialize all the array elements of allClients to have default values?</p>
  
  <p>I have tried the following but I am getting 'incomplete definition of type struct':</p>
  
  <pre><code>for(int i = 0; i&lt;4; i++) {
          allClients[i]-&gt;socket = 0;  
          allClients[i]-&gt;port = NULL;
          allClients[i]-&gt;IP = NULL;
          allClients[i]-&gt;hostName = NULL;
          allCLients[i]-&gt;msgSentCount = 0;
          allClients[i]-&gt;msgRecvCount = 0;    
          allClients[i]-&gt;status = NULL;
          allClients[i]-&gt;bufferMsg = "";
          allClients[i]-&gt;blockedUser = {"","","",""};
          allClients[i]-&gt;blockedCount = 0;    
  }
  </code></pre>