title: simple input. program crashes
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main(){        
      char *command="0";
  
      do {   
        printf("[A]dd, [P]rint, [Q]uit\n");
        scanf("%s", command);
  
      while (strcmp(command, "a") != 0 &amp;&amp; strcmp(command, "A") != 0 &amp;&amp; strcmp(command, "p") != 0 &amp;&amp; strcmp(command, "P") != 0){
          printf("Invalid input. Please enter one of the commands listed above.\n");
          scanf("%s", command);
      }       
  
         if (strcmp(command, "a") == 0 || strcmp(command, "A") == 0){
             printf("You selected add.\n");
         }
         else if (strcmp(command, "p") == 0 || strcmp(command, "P") == 0){
             printf("You selected print.\n");
         }
      }while (strcmp(command, "q") != 0 &amp;&amp; strcmp(command, "Q")!= 0);
      return 0;
  }
  </code></pre>
  
  <p>I want the program to take in a letter from the user from one of the specified commands printed in the beginning. I want the program to exit if they enter q or Q. Took me a while simply to figure out how to do comparisons with strings for the loops and ifs. now when i run the program it crashes though. Looking for insight as to why its crashing.</p>