title: argv and polish notation calculator
body: <p>I'm trying to solve a K&amp;R exercise(5.10) that uses the argc and argv arguments.It's supposed to be a polish notation calculator that uses command line arguments as its' input.Well,the program runs fine for the '+' and '-' operators but I get errors for '*'.I figured out that it has something to do specifically with the '*' symbol,because if I replace it with something else the program works.Any ideas?Thank you.<br>
  Note:I didn't include the functions stack_in,stack_out and print_stack.I think they're good.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define MAXST 10
  #define NUMBER '1'
  
  void stack_in(int n);
  int stack_out(void);
  void print_stack(void);
  
  int main(int argc,char **argv)
  {
    char c,k;
  
  while(--argc&gt;0 &amp;&amp; ++argv)
      while(c=*(*argv)++){
          if(c&gt;='0' &amp;&amp; c&lt;='9')
              k=NUMBER;
          else
              k=c;
          switch (k){
              int g1,g2;
  
              case NUMBER:stack_in(c-'0');
                      break;
              case '+':g1=stack_out();
                   g2=stack_out();
                   stack_in(g1+g2);
                   break;
              case '-':g1=stack_out();
                   g2=stack_out();
                   stack_in(g2-g1);
                   break;
              case '*':g1=stack_out();
                   g2=stack_out();
                   stack_in(g1*g2);
                   break;
              default:printf("error on switch \n");
                  break;
          }
  }
  
  print_stack();
  
  return 0;
  }
  </code></pre>