title: Beginner: syntax error before int main ()
body: <p>I'm trying to run a Hello World program but am getting the error</p>
  
  <pre><code>./ex1.c: line 3: syntax error near unexpected token `(`
  ./ex1.c: line 3: `int main (int argc, char *argv[])'
  </code></pre>
  
  <p>or</p>
  
  <pre><code>./ex1.c: 3: ./ex1.c: Syntax error: "(" unexpected
  </code></pre>
  
  <p>or</p>
  
  <pre><code>./ex1.c:3: unknown file attribute: i
  ./ex1.c:4: parse error near `}'
  </code></pre>
  
  <p>The weird thing is I've run this same program before and had no issues.</p>
  
  <p>Not sure if these issues are related but the problem happened after I installed Valgrind to run exercise 4 in Learn C The Hard Way. I received an error that said permission denied which I fixed using <code>chmod +x</code>. Then all my <code>.c</code> files needed permission which they had not before. I then did <code>chmod -R 0777</code> for the directory with all of my .c practice files. So the permission problem is fixed but then the error above started. They may be completed unrelated but wanted to include just in case. </p>