title: Compile Error in C: error: expected expression before ‘.’ token
body: <p>I'm brand new to C, (like started 2 days ago) and I am having compile issues due to syntax but the error messages I am getting from gcc are not helping me much. I compiled as follows: <code>gcc -ansi -Wall -pedantic line.c</code></p>
  
  <p>The whole thing is a simple introductory exercise fro my 101 class. The values are just tested against each other to make sure they were assigned properly in a line_test.c file. But before I can address that one's compile issues I need to address this file.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include "line.h"
  
  struct line2d create_line2d (double x1, double y1, double x2, double y2) {
      struct line2d line;
      line.x1=1;
      line.y1=2;
      line.x2=3;
      line.y2=4;
      return line;
  }
  </code></pre>
  
  <p>and the line.h code:</p>
  
  <pre><code>#ifndef line
  #define line
  
  struct line2d {
      double x1;
      double y1;
      double x2;
      double y2;
  };
  
  struct line2d create_line2d(double x1, double y1, double x2, double y2);
  
  #endif
  </code></pre>
  
  <p>and here is the error it throws</p>
  
  <pre><code>line.c: In function ‘create_line2d’:
  line.c:5: error: expected expression before ‘.’ token
  line.c:6: error: expected expression before ‘.’ token
  line.c:7: error: expected expression before ‘.’ token
  line.c:8: error: expected expression before ‘.’ token
  line.c:9: warning: ‘return’ with no value, in function returning non-void
  </code></pre>