passing arguments and returns between c# application and c++ exe file
<p>I want to call an c++ exe file into my c# application that takes a command line argument and returns the result so that i can use it in my c# application but i don't know how to do it . </p>

<p>here's the simple sample that i tried and failed : 
c++ code : returner.exe</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;cstdlib&gt;
using namespace std;
int main(string argc , string argv)
{
    int b= atoi(argv.c_str());
    return b;
}
</code></pre>

<p>c# code :</p>

<pre><code> private void button1_Click(object sender, EventArgs e)
        {
            ProcessStartInfo stf = new ProcessStartInfo("returner.exe", "3");
            stf.RedirectStandardOutput = true;
            stf.UseShellExecute = false; 
            stf.CreateNoWindow = true;

            using (Process p = Process.Start(stf))
            {
                p.WaitForExit();
                int a = p.ExitCode;
                label1.Text = a.ToString();
            }
        }
</code></pre>

<p>i expect to see 3 in the lable . but it's always 0 . what should i do ?</p>
