Q:

C input char and int separated by whitespace

I need to parse input like this: "+ 704"
Into: switcher = "+" and c = 749
I got this:
scanf("%c %d", &switcher, &c);

This does not work.
Scanf returns 1 instead of 2, c = 4196080 and printf("%c", switcher) prints a newline.
What am i missing?

A:

So basically, there's a newline waiting on the buffer. To get rid of it, simply add one space to the beginning of your formatting string.
scanf(" %c %d", &switcher, &c);

