title: illegal hardware instruction error when concatenating two strings in c
body: <p>I want to loop through a text file and concatenate all the strings until a blank line is hit and then do the same for the next strings and so on. The result of each string concatenation should be added to an char* array:</p>
  <pre><code>char* element_arr[287];
  
  void splitPassports(FILE* file_to_read){
       char element[500];
       char str[80];
       int i = 0;
       int j = 0;
  
       while(j &lt; FILELENGTH){
           if (fgets(str,80, file_to_read) &amp;&amp; !isBlank(str)){
               strcat(element,str);
               printf(&quot;The string is: %s\n&quot;,str);
           }else if (isBlank(str)){
               element_arr[i] = element;
               memset(element, '\0', sizeof element);
               printf(&quot;%s\n&quot;,element_arr[0]);
               i++;
           }
           j++;
       }
  
       fclose(file_to_read);
   }
  </code></pre>
  <p>However when I try to do this I get an illegal hardware instruction error (I'm on a Mac). How can I properly add the new strings to the existing one and then append that to my array and after that set it back to zero to do the same for the few lines until a blank line is hit?
  I'm relatively new to C so thanks in advance :)</p>