C++ code elegance
<p>Is it considered proper to have code like this:</p>

<pre><code>#include &lt;FILEHERE&gt;
using namespace std;

char input;

int main() {
    cin &gt;&gt; input;
    cout &lt;&lt; input;

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

<p>I know that this code will work, but is is considered proper and is there a better wat to do it? </p>

<p>The reason I am using code similar to this, (but far more complex), is because I have a thread and the main function both using this string at some point, and the only way I could think to declare it for both the thread and main function was to declare it outside the thread and main function. What is a better way to do this?</p>

<p>EDIT: I am not asking about using <code>namespace std;</code> as I use it in almost every program I write.</p>
