title: scanf ends my program and no error is thrown
body: <p>I am a beginner in C and I encountered problems when dealing with <code>scanf</code>, hoping for an explanation behind this</p>
  <p>this is my code</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  #include &lt;string.h&gt;
  
  int fav_charac() {
      char *string = &quot;&quot;; 
      printf(&quot;whats your fav letter?: &quot;);
      scanf(&quot;%s&quot;, string);                         // the problem
      printf(&quot;your fav letter is %s\n&quot;, string);
  }
  
  int main() {
      fav_charac();
      return 0;
  }
  </code></pre>
  <p>and this is the program running</p>
  <pre><code>whats your fav letter?: a
  
  C:\Users\DELL\source\repos\hello C\x64\Debug\hello C.exe (process 15052) exited with code -1073741819.
  Press any key to close this window . . .
  </code></pre>
  <p>as you can see it exited right after an input is made, why?</p>