Why is my program behaving oddly
<p>I have just started work on asmall program that sends text over net (TON) I havent quite started but when I compile this happens when I have a space in my name</p>

<pre><code>Username: Knight Hawk3
LAN (1) or Net (0):
(Here it wont let me enter data)
Process returned 1 (0x1)   execution time : 3.670 s
Press any key to continue.
</code></pre>

<p>Here is what normally (should) happen</p>

<pre><code>Username: Knight
LAN (1) or Net (0):
1

Process returned 1 (0x1)   execution time : 2.134 s
Press any key to continue.
</code></pre>

<p>Here is my source</p>

<pre><code>////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include &lt;SFML/Window.hpp&gt;
#include &lt;SFML/System.hpp&gt;
#include &lt;SFML/Graphics.hpp&gt;
#include &lt;SFML/Network.hpp&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;

using namespace std;

bool firstrun = true;

int main()  {

    if (firstrun) {
        cout &lt;&lt; "Username: ";
        string name = "";
        cin &gt;&gt; name;
        while (name == "") {
            cout &lt;&lt; "Invalid Enter a new name: ";
            cin &gt;&gt; name;
            cout &lt;&lt; "\n";
        }
    }
    cout &lt;&lt; "LAN (1) or Net (0): ";
    int type;
    cout &lt;&lt; "\n";
    cin &gt;&gt; type;
    while (type &lt; 0) {
            cout &lt;&lt; "Invalid LAN (1) or Net (0): ";
            cin &gt;&gt; type;
    }

    return true;
}
</code></pre>

<p>I am running WIN7, Using Code::Blocks</p>

<p>Why is this happening with a space?</p>
