title: integer arguments for c++
body: <p>I have a sort of calculator in C++ that should accept arguments when executed. However, when I enter 7 as an argument, it might come out to be 10354 when put into a variable. Here is my code:</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  
  int main(int argc, int argv[])
  {
      using namespace std;
      int a;
      int b;
      if(argc==3){
          a=argv[1];
          b=argv[2];
      }
      else{
          cout &lt;&lt; "Please enter a number:";
          cin &gt;&gt; a;
          cout &lt;&lt; "Please enter another number:";
          cin &gt;&gt; b;
      }
      cout &lt;&lt; "Addition:" &lt;&lt; a+b &lt;&lt; endl;
      cout &lt;&lt; "Subtaction:" &lt;&lt; a-b &lt;&lt; endl;
      cout &lt;&lt; "Multiplycation:" &lt;&lt; a*b &lt;&lt; endl;
      cout &lt;&lt; "Division:" &lt;&lt; static_cast&lt;long double&gt;(a)/b &lt;&lt; endl;
      system("pause");
      return 0;
  }
  </code></pre>