title: Comparing input character to an array of ints in C
body: <p>I am kinda new to C and I am having trouble using If statements to compare character input from the user to an int stored in an array.</p>
  
  <p>Eg:</p>
  
  <pre><code>    int i[2] = {1,2};
      char input[3];
      printf("Select option:");
      fgets(input,3,stdin);
  
      if(strcmp(*input,i[0]) == 0)
         printf("1 chosen");
      if(strcmp(*input,i[1]) == 0)
         printf("2 chosen");
  </code></pre>
  
  <p>When compiling I get a warning for both compare statements saying:</p>
  
  <pre><code>    warning: passing argument 1 of 'strcmp' makes pointer from integer without cast
      warning: passing argument 2 of 'strcmp' makes pointer from integer without cast   
  </code></pre>
  
  <p>I understand that this maybe because Im comparing non-string elements, but how will I cast them then compare them?</p>
  
  <p>When executing I get:</p>
  
  <pre><code>     Segmentation fault(core dumped)
  </code></pre>
  
  <p>Can somebody help?</p>