Is extern "C" on a c++ function allowed?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1041866/in-c-source-what-is-the-effect-of-extern-c">In C++ source, what is the effect of extern “C”?</a>  </p>
</blockquote>



<p>I am asking this because I'm writing a C++ program which uses a C library. This library has <code>foreach</code> functions that take a callback (naturally). Obviously, the library would call my callbacks as C functions.</p>

<p>First of all, <strong>does this have anything to do with linkage of C vs C++?</strong></p>

<p>If it does, <strong>is something like this valid and correct?</strong></p>

<pre><code>extern "C" static bool callback(/*parameters*/)
{
    cout &lt;&lt; "C++ thing inside the function" &lt;&lt; endl;
    /* etc */
}
</code></pre>
