title: Trying to access int from a struct pointer: compiles but does not run
body: <p>I am trying to access an <code>int</code> from the <code>struct</code> pointer <code>pPoint</code>. The following code compiles, but when the program is run at the command prompt, my computer says the program has stopped working.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  typedef struct point *pPoint;
  
  struct point {
      int num;
      pPoint pt2; 
  } pt1;
  
  int main() {
      pt1.num = 9;
      pt1.pt2-&gt;num = 7;
      printf("%d ", pt1.num);
      printf("%d\n", pt1.pt2-&gt;num);
      return 0;
  }
  </code></pre>
  
  <p>Where is the error and what needs to be changed?</p>