title: Basic pointer exercise error
body: <p>I started studying pointers and I got in some trouble with the next code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int * g()
  {
      int a = 10;
      return &amp;a;
  }
  
  void main()
  { 
      int *p;
      p=g();
      printf("%d",*p);
  }
  </code></pre>
  
  <p>It returns the error <code>segmentation fault. core dumped</code></p>
  
  <p>I would really apreciate any help. Have a nice day!</p>