title: Unhandled exception at Access violation reading location
body: <p>I wrote the following C program in Visual Studio 2013:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(){
    int number;
    int fibonacci(int number);
  
    printf("please enter number\n");
    scanf_s("%d", &amp;number);
  
    printf(fibonacci(number));
    return 0;
  }
  
  int fibonacci(number){
    if (number == 1 || number == 0){
      return number;
    }
    else{
      return fibonacci(number - 1) + fibonacci(number - 2);
    }
  }
  </code></pre>
  
  <p>It gives me this error:</p>
  
  <blockquote>
    <p>Unhandled exception at 0x5867F365 (msvcr120d.dll) in Project7.exe: 0xC0000005: Access violation reading location 0x00000002.</p>
  </blockquote>
  
  <p>I think this is about dereferencing a null pointer. How do I fix it?</p>