title: Running total in C
body: <p>I'm new to StackOverflow and I had a simple question.</p>
  
  <p>I'm writing a program that accepts strings and numbers. 
  I used <code>fgets</code> to take care of the strings part. </p>
  
  <p>Summary(view previous edits if you want more gist of the problem):</p>
  
  <p>As per Simone's suggestion, here is what I have so far:</p>
  
  <pre><code>int value = -1;
  int check = sscanf(command, "%i%c", &amp;value, dummy);
  if (check == 1) {
      sscanf(command, "%d" , &amp;command_value);
      sum = sum + command_value;
      printf("Sum is now %d\n", sum);
  }
  else if (check == 2) {
      printf("Command unrecognized.\n");
  }           
  </code></pre>
  
  <p>The problem now is that It does print out the sum but with it also prints out "command unrecognized". I think I messed up the syntax again.</p>