title: Initializing a pointer to a structure
body: <p>another linked question is <a href="https://stackoverflow.com/questions/6288642/segmentation-fault-while-doing-strcpy/6288697#6288697">Segmentation fault while using strcpy()?</a></p>
  
  <p>I have a structure:</p>
  
  <pre><code>struct thread_data{    
      char *incall[10];
      int syscall arg_no;    
      int client_socket;
   }; 
  </code></pre>
  
  <p>How do I initialize a pointer to a structure of type above as well as initialize the pointer to the 10 strings (incall[]) inside the structure.</p>
  
  <p>Do I first initialize the strings and then the structure.</p>
  
  <p>Thanks.</p>
  
  <p>An edit: I guess I used the wrong word and should have said allocate. Actually I am passing this structure as an argument to threads. No. of threads is not fixed and the data structure sent as argument must be unique for each thread and "thread safe" i.e cannot be changed by other threads.</p>