title: warning: second argument of ‘int main(int, char***)’ should be ‘char **’ [-Wmain] (GNU C++ compiler; Ubuntu 12.10)
body: <p>Trying to clone the "yes" command using C++ as a little experiment (this is on Ubuntu 12.10), and there's a little problem here:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstring&gt;
  #include &lt;cstdio&gt;
  #include &lt;cmath&gt;
  #include &lt;cstdlib&gt;
  
  using namespace std;
  
  void yes (char* cmd[]) {
    if ( cmd != NULL ) {
      while (true) {
        cout &lt;&lt; cmd[1] &lt;&lt; endl;
      }
    } else {
      while (true) {
        cout &lt;&lt; "y" &lt;&lt; endl;
      }
    }
  }
  
  int main(int argc, char** argv[]) {
    yes(argv[1]);
    return 0;
  }
  </code></pre>
  
  <p>If I leave it as is, I get the warning as described in the title. If I remove one of the asterisks on argv, I get an error about converting "char*" to "char**". And removing the extra function (i.e. putting it all in main, like so):</p>
  
  <pre><code>int main(int argc, char** argv) {
    if ( argv != NULL ) {
      while (true) {
        cout &lt;&lt; argv[1] &lt;&lt; endl;
      }
    } else {
      while (true) {
        cout &lt;&lt; "y" &lt;&lt; endl;
      }
    }
    return 0;
  }
  </code></pre>
  
  <p>makes no difference about the warning.</p>
  
  <p>Thanks in advanced...</p>