title: Access command line arguments in C++
body: <p>Is it possible to get the command line arguments without receiving them via int main(int, char**)? I don't want to pass the arguments to multiple methods, so a global function would be perfect. Also, I do not want to store the arguments by myself via global variables. I'm running Windows and Linux.</p>
  
  <p><strong>edit:</strong>
  Example:</p>
  
  <pre><code>int main()
  {
     int argc = GetArgumentCount();
     char ** argv = GetArguments();
     return 0;
  }
  </code></pre>
  
  <p><strong>edit:</strong>
  It's possible to use <em>LPTSTR WINAPI GetCommandLine(void);</em> in win32.</p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/ms683156(v=vs.85).aspx" rel="noreferrer">https://msdn.microsoft.com/en-us/library/ms683156(v=vs.85).aspx</a></p>
  
  <p>I'm looking for equivalent functions in Linux.</p>