title: Segmentation fault using fgets()
body: <p>I am making a basic program, and decided to use functions, and pointers, in the first input I have the choice of typing either, "kitchen", or "upstairs", however when I use <code>fgets()</code> I am getting a segmentation fault, and have no idea why. I tried to print out the string to see if I was getting the correct output, of course due to the segmentation fault it's not happening.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  char one(char *oOne[]);
  void two();
  void three();
  
  int main() {
      char *oOne[10], oTwo[10], oThree[10]; // Options one, two, and three.
      puts("WELCOME TO ASAD'S ADVENTURE");
      puts("");
      one(oOne);
      return 0;
  }
  
  char one(char *oOne[]) {
      puts("You are in a creepy house! Would you like to go \"upstairs\", or into the \"kitchen\"?");
  
      printf("\n&gt; ");
  
      if (fgets(*oOne, sizeof *oOne, stdin) == NULL) { // Receiving the input from the user, and removing the \n caused by fgets().
          puts("EOF Occurred");
          return 1;
      }
  
      *oOne[strcspn(*oOne, "\n")] = 0;
      printf("%s\n", *oOne);
      // puts(*oOne);
  }
  </code></pre>
  
  <p>Here is the output I am receiving:</p>
  
  <pre><code>WELCOME TO ASAD'S ADVENTURE
  
  You are in a creepy house! Would you like to go "upstairs", or into the "kitchen"?
  
  &gt; kitchen
  Segmentation fault
  </code></pre>
  
  <p>How can I fix the segmentation fault?                                     </p>