title: syntax error before "char" in C
body: <p>I have the following piece of code, which when I compile it, I get:</p>
  
  <blockquote>
    <p>smash.c:22 error: syntax error before "char"</p>
  </blockquote>
  
  <p>I don't understand where the problem is. (line 22 is marked by <code>/*22*/</code> in the error message, but line numbers do not appear in the code). How can I correct this error?</p>
  
  <pre><code>/*some comments...*/
  /*some more comments...*/
  
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;signal.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;sys/wait.h&gt;
  #include &lt;errno.h&gt;
  
  #include "dir_handling.h"
  #include "var_handling.h"
  
  
  
  #define     MAXLENGTH           80        
  
  void error_print (char* str)
  {
      /*22*/ char *error_message=(*char)malloc((strlen(str)+strlen("smash error: &gt; \"\"\n")+1)*sizeof(char));
      strcpy (error_message,"smash error: &gt; \"");
      strcat(error_message,str);
      strcat(error_message,"\"\n");
      perror (error_message);
      free (error_message);
      // printf ("smash error: &gt; \"%s\"\n",str);
  }
  ...
  </code></pre>