title: Custom Command Line Parameters
body: <p>I have a problem with command line parameters. I finished the program so I can start it like this from command line:</p>
  
  <pre><code>program.exe test.txt copy_test.txt
  </code></pre>
  
  <p>Basically, my program does the following :</p>
  
  <ul>
  <li>inputs some text file</li>
  <li>sorts it and copy to a new text file</li>
  </ul>
  
  <p>BUT (always that but?!), I should start the program from command line like this:</p>
  
  <pre><code>program.exe -input=test.txt -output=copy_test.txt
  </code></pre>
  
  <p>And I don't know how to do that. I researched, but I didn't find any help :(</p>
  
  <p>Please respond.</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  using namespace std;
  
  int main ( int argc, char* argv[])
  {
   ifstream in(argv[1]);
   ofstream out(argv[2]);
   vector &lt;string&gt; sV;
   string line;
   while (in &gt;&gt; line)
    sV.push_back(line);
   for ( int i = 0; i &lt; sV.size(); i++)
   sort ( sV.begin(), sV.end () );
   for ( int i = 0; i &lt; sV.size(); i++)
   out &lt;&lt; sV[i] &lt;&lt; endl;
   cin.get();
   return 0;
  }
  </code></pre>