title: pointer to integer type modeled on pointer to typedef type
body: <p>For didactic motives, i want to build a pointer to an integer, and i take a model from a pointer to a typedef (working example below in (1) ) but the example at (0) gives the mesage   "error: syntax error before '=' token" at   ptr =&a;      and i can not understand why. I will thank the correction.The code is:</p>
  
  <p>(0)  //failing code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  typedef int  *ptr;
  
  int main(){
  int a;
  ptr =&amp;a;      //&lt;-----"error: syntax error before '=' token"
  a =2;
  printf("%d\an",a);
  return 0;
  }
  </code></pre>
  
  <p>(1)  //working code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  typedef struct sum {
  int a,b,c;
  } mytype;
  
  int main(){
  
  mytype  sum_operation;    
  mytype *ptr;
  
  ptr = &amp;sum_operation;
  
  (*ptr).a = 1;
  (*ptr).b = 3;       
  
  (*ptr).c =(*ptr).b + (*ptr).a  ;
  printf("%d\n",(*ptr).c);
  
  return 0;
  }
  </code></pre>