title: Converting a command line argument into char
body: <p>I'm working with a command line arguments for the first time and I need to convert one of the string arguments to a character for testing. I tried testing it as a string and it wasn't working. In the program the user needs to enter an e or E or d or D (sample input at top of code). I haven't done much with conversions in C either so any help would be great. Thanks.</p>
  
  <p>Input is: <code>./filename 4 1 7 e</code> </p>
  
  <pre><code>int main(int argc, char *argv[])
  {
     char letter = argv[4];
     if(argc != 5)
     {
        printf("Error - wrong number of inputs args\n");
        return -1;
     }
  
     if(letter != 'd' || letter != 'D' || letter != 'e' || letter != 'E')
     {
        printf("Error - E or D not entered\n");
        return -1;
     }
  }
  </code></pre>