title: Taking input string from keyboard in C using pointer notation?
body: <p>I am trying to take in string from keyboard. When I tried this it didn't work.</p>
  
  <pre><code>char *s;
  fgets(s,80, stdin);
  </code></pre>
  
  <p>I get a segmentation fault when I am trying to use the above code. However when I use below code it works, and I don't get a segmentation fault.</p>
  
  <pre><code>char s[81];
  fgets(s, 80, stdin);
  </code></pre>
  
  <p>Why do I segmentation fault when I try to store the string using pointer (<code>char *s</code>)?</p>