title: error: ' ' was not declared in this scope
body: <p>So I'm making a simple geometry program, and do a test compile.</p>
  
  <p>For some reason, when i compile this code, i get the following error:</p>
  
  <pre><code>base.cc: In member function ‘void seg::init_seg(p, p)’:
  base.cc:20:3: error: ‘mid’ was not declared in this scope
  base.cc:22:3: error: ‘b’ was not declared in this scope
  </code></pre>
  
  <p>But interestingly, the error doesn't appear for points 1 and 2, only mid and b.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;math.h&gt;
  
  struct p{
      float x=0.0f,y=0.0f;
      void init_p(float sx, float sy){
          x = sx;
          y = sy;
          }
      };
  
  struct seg{
      p 1, 2, mid, b;
      float length = 0.0f, m = 0.0f;
      void init_seg(p p1, p p2){
          1.init_p(p1.x, p1.y);
          2.init_p(p2.x, p2.y);
          length = sqrt((1.x - 2.x)^2 + (1.y - 2.y)^2);
          mid.init_p((1.x + 2.x)/2, (1.y + 2.y)/2 );
          m = ((1.y - 2.y)/(1.x - 2.x));
          b.init_p(0, (1.y - (m*1.x)));
          }
  };
  </code></pre>
  
  <p>Why does this error appear, and why only for these two points?</p>