One place where extern "C" makes sense is when you're linking to a library that was compiled as C code.
extern "C" {
#include "c_only_header.h"
}
Otherwise, you might get linker errors because the library contains the functions with C-linkage (_myfunc) but the C++ compiler, which processed the library's header as C++ code, generated C++ symbol names for the functions ("_myfunc@XAZZYE" - this is called mangling and different for each compiler).
Another place where extern "C" is used is to guarantee C linkage even for functions written in C++, eg.
extern "C" void __stdcall PrintHello() {
cout << "Hello World" << endl;
}
Such a function can be exported to a DLL and will then be callable from other programming language because the compile will not mangle its name. If you added another overload of the same function, eg.
extern "C" void __stdcall PrintHello() {
cout << "Hello World" << endl;
}
extern "C" void __stdcall PrintHello(const char *name) {
cout << "Hello, " << name << endl;
}
Most compilers would then catch this and thus prevent you from using function overloads in your DLL-public functions.