Preventing console window to close itself after returning value
<p>I'm c++ newbie. My first app looks like that.</p>

<pre><code>#include "stdafx.h"
#include &lt;iostream&gt;
using namespace std;
int add (int x, int y);

int add (int x, int y){
return (x+y);
}
int _tmain(int argc, _TCHAR* argv[])
{
    int x, y;
    cin &gt;&gt;x&gt;&gt;y;
    cout &lt;&lt;add (x,y);
    cin.get();
    return 0;
}
</code></pre>

<p>Got 2 questions:</p>

<ol>
<li>Why console window closing itself directly after function returns value even if I used <code>cin.get();</code>? </li>
<li>I tested this application without <code>int add (int x, int y);</code> line at the top of file. It worked well. Do I need to write prototype for every function or application works without it too? </li>
</ol>
