Alternative way to obtain argc and argv of a process
<p>I'm looking for alternative ways to obtain the command line parameters <code>argc</code> and <code>argv</code> provided to a process without having direct access to the variables passed into <code>main()</code>.</p>

<p>I want to make a class that is independent of <code>main()</code> so that <code>argc</code> and <code>argv</code> don't have to be passed explicitly to the code that uses them.</p>

<p>EDIT: Some clarification seems to be in order. I have this class.</p>

<pre><code>class Application
{
  int const argc_;
  char const** const argv_;

public:
  explicit Application(int, char const*[]);
};

Application::Application(int const argc, char const* argv[]) :
  argc_(argc),
  argv_(argv)
{
}
</code></pre>

<p>But I'd like a default constructor <code>Application::Application()</code>, with some (most probably) C code, that pulls <code>argc</code> and <code>argv</code> from somewhere.</p>