scanf is not waiting for user input in a while loop
<p>I have just started an Operating Systems class this summer and we are required to program in C.</p>

<p>I have only coded in C++ so I am brand new to C. Our first assignment is a simple prompt for input of multiple strings. We can only read in up to 10 strings.</p>

<p>My problem is that the <code>scanf()</code> is not waiting for the user input in the loop, the program just displays the prompt 10 times before I have a chance to enter anything. I have read that it is because <code>scanf()</code> has the newline char in the buffer so I added an extra space before <code>%c</code> in <code>scanf()</code> statement as suggested but that has not fixed the problem.</p>

<pre><code>#include &lt;stdio.h&gt;

int main (void)
{
    int SIZE = 10;
    char* states[SIZE];
    int cnt = 0;

    printf ("Here\n");
    while (cnt &lt; 10)
    {
        printf ("Enter State and Pop: ");
        scanf (" %c ", &amp;states[cnt]);
        cnt++;
        printf ("%d\n", cnt);
    }
    return 0;
}
</code></pre>