Error while compiling a C++ program with G++ : <p>v This is <code>main.cpp</code>:</p>

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

using namespace std;

int main() {
    cout &lt;&lt; "Hello, World!" &lt;&lt; endl;
    return 0;
}
</code></pre>

<p>To compile it, I go into cmd and type <code>g++ main.cpp</code> but it gives me 2 errors, saying that both <code>cout</code> and <code>endl</code> aren't declared. I can only imagine that it's because it can't find the namespace <code>std</code> or can't include <code>&lt;stdio.h&gt;</code>. How would I make this work?</p>
