title: C++ capture command line entered and output line by line
body: <p>I'm writting a c++ program and I am looking to capture the inputs from command line. For each argument that is entered in the command line it is to be captured. The program will capture every command line until the user enters END. The program will then provide an output of each commandline argument that was entered. Example: User enters <em>./program</em> to run this program. <em>./program</em> is captured. User then enters <em>test</em> this is then captured user then enters <em>arg</em> then <em>END</em>. The program then outputs</p>
  
  <ul>
  <li><strong>./program</strong></li>
  <li><strong>test</strong></li>
  <li><strong>arg</strong></li>
  </ul>
  
  <p>This is what I found for a resource I just don't know how to fully implement and loop <a href="http://www.cplusplus.com/articles/DEN36Up4/" rel="nofollow">http://www.cplusplus.com/articles/DEN36Up4/</a><br>
  Below is what I have so far, just not sure of the for loop waiting for the END 
  thanks! </p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main(int argc, char* argv[])
  {
      std::cout &lt;&lt; "Enter your command line \n and to stop enter END" &lt;&lt; std::endl;
      for (int i = 0; i &lt; count; ++i)
      {
          /* code */
      }
      // Once user types END then arguments entered in will display
      std::cout &lt;&lt; &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>