title: my C program crashing for an unseen reason
body: <p>So my program is meant to be a little command line but it keeps crashing:</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;ctype.h&gt;    
  
  void main()
  {    
      char cmd;
      for(;;)
      {
          fgets(cmd,255,stdin);
          if (strstr(cmd,"CD")!=NULL )
          {
              cmd +=2;
              SetCurrentDirectory(cmd);
          }
          else
          {
              system(cmd);
          }
      }
  }
  </code></pre>
  
  <p>the compiler output is lvalue expected.</p>