1. This has to do "name mangling" explained below, and
2. It is used for "connecting" C and C++ code, so that your project can
include both.
Suppose you write a method named "foobar". When your compiler turns your
code into an executable, it doesn't have to retain the *name* foobar; it can
change it let's say into "shmilky", as long everyone else knows that
"shmilky" really means the method you called "foobar". As a *user* of the
compiler, you usually shouldn't have to care about this.
Why would your compiler do that in the first place? probably not much of
an issue if you're not writing a compiler (check name mangling in Google, if
you're interested).
Why the extern "C", then? C and C++ are different languages, and would
understand "shmilky" differently. The extern "C" causes both of them to
understand that "shmilky" stands for "foobar" (which is what you want).
"snnn" <sn*****@gmail.com.haha.removeme> wrote in message
news:uk***********@gmail.com.haha.removeme...
///////////////////////
#ifdef __cplusplus
extern "C" {
#endif
////////////////////////
I often find it at c/c++ head files.