title: When to use extern "C" in simple words?
body: <p>Maybe I'm not understanding the differences between C and C++, but when and why do we need to use</p>
  
  <pre><code>extern "C" {
  </code></pre>
  
  <p>? Apparently its a "linkage convention".</p>
  
  <p>I read about it briefly and noticed that all the .h header files included with MSVS surround their code with it. What type of code exactly is "C code" and NOT "C++ code"?  I thought C++ included all C code?</p>
  
  <p>I'm guessing that this is not the case and that C++ is different and that standard features/functions exist in one or the other but not both (ie: printf is C and cout is C++), but that C++ is backwards compatible though the extern "C" declaration. Is this correct?</p>
  
  <p>My next question depends on the answer to the first, but I'll ask it here anyway: Since MSVS header files that are written in C are surrounded by extern "C" { ... }, when would you ever need to use this yourself in your own code?  If your code is C code and you are trying to compile it in a C++ compiler, shouldn't it work without problem because all the standard h files you include will already have the extern "C" thing in them with the C++ compiler?</p>
  
  <p>Do you have to use this when compiling in C++ but linking to already built C libraries or something?</p>