How can I input multiple variables on the same line C++
<p>So I am trying to input multiple variables on the same line and have it call a function and parse some of the variables to a function it will call. For example the user will enter something like</p>

<pre><code>COMMAND &lt;integer&gt;
</code></pre>

<p>I have tried using scanf however when it does work it doesn't seem to recognize the variable I passed. I am certain I am just making a silly mistake but can someone please help me? I wrote a simple program to try to test passing variables like this which I have included below.</p>

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

using namespace std;

string derp(int test) {
    cout &lt;&lt; "and here " + test &lt;&lt; endl;
    return "derp " + test;
}


void main() {
    char command[20];
    int *bla(0);
    scanf("%s %u", &amp;command[0], &amp;bla );
    if (strcmp(command, "derp") == 0) {
        cout &lt;&lt; "works here" &lt;&lt; endl;
        cout &lt;&lt; derp(*bla);
    }
}
</code></pre>