' ' seems to be treated as '\0'?
<h1>Code</h1>

<p>I created the following program:</p>

<pre><code>#include &lt;iostream&gt;

void f(char v[])
{
    for(char* p = v; *p != 0; p++)
    {
        std::cout &lt;&lt; *p &lt;&lt; std::endl;
    }
}

int main()
{
    std::cout &lt;&lt; int(' ') &lt;&lt; std::endl;
    char c[256];
    std::cin &gt;&gt; c;
    f(c);
    return 0;
}
</code></pre>

<h1>Compiler</h1>

<p>I compiled with GNU GCC Compiler in Code::Blocks with the -std=c++0x flag (with no warnings).</p>

<h1>Problem</h1>

<p>The problem I have is that if I enter a string containing one or more spaces (i.e. "one and two") then only the letters prior to the first space are printed (i.e. 'o', 'n', 'e').</p>

<h1>What I've tried</h1>

<p>The only thing that sprung to mind was to do a quick reality check. I added the line:</p>

<pre><code>std::cout &lt;&lt; "Val: " &lt;&lt; int(' ') &lt;&lt; std::endl;
</code></pre>

<p>and, as expected, the value printed <em>isn't</em> 0 (because, obviously, it's not the null '\0' character)...</p>

<p>I'm not sure what I'm missing. Is it the case that the line:</p>

<pre><code>std::cin &gt;&gt; c;
</code></pre>

<p>uses ' ' as some sort of termination character?</p>

<p>Thanks.</p>
