title: Why isn't the 'strcat' function working?
body: <p>I am trying to concatenate arrays from a structure using <code>strcat</code>. My code looks as follows:</p>
  
  <pre><code>int main(){
  
  //Implementation of Search table Tree
  
  struct searchTable
  {
      char first[10];
      int first_id;
      char second[10];
      int second_id;
      char third[10];
      int third_id;
      char fourth[10];
      int fourth_id;
      char fifth[10];
      int fifth_id;
  
  }input[5]= {
          {"ABC", 101},
          {"CAB",102},
          {"ACB",103},
          {"AAC",104},
          {"CCB",105}
  };
  char join[100]={0};
  
  strcat(join, input[0].first);
  strcat(join, input[1].second);
  strcat(join, input[2].third);
  strcat(join, input[3].fourth);
  strcat(join, input[4].fifth);
  
  printf("%s", join);
  </code></pre>
  
  <p>Here the output instead of giving me  </p>
  
  <blockquote>
    <p>ABCCABACBAACCCB </p>
  </blockquote>
  
  <p>gives me just </p>
  
  <blockquote>
    <p>ABC</p>
  </blockquote>
  
  <p>Could somebody tell me what I am doing wrong?</p>