title: Is it legal C++ to declare main as extern "C"?
body: <p>Being a low-level programmer, I often work with the module startup code for executables, so I understand pretty well how code like "crt0" work.  When writing C++ code, I've generally declared <code>main</code> as <code>extern "C"</code> to match what the C startup code is going to do to call <code>main</code>.  I thus usually use this declaration for <code>main</code> (and <code>wmain</code> if specifically targeting Windows):</p>
  
  <pre><code>extern "C" int main(int argv, const char *const *argv)
  
  extern "C" int __cdecl wmain(int argv, const wchar_t *const *argv)
  </code></pre>
  
  <p>Is it legal to use <code>extern "C"</code> on <code>main</code>?  Also, is <code>const char *const *</code> legal for argv's type as opposed to <code>char *[]</code>?</p>