Possible Duplicate:
Why do we need extern āCā{ #include <foo.h> } in C++?
many a times in our code i have seen some statements like following:
extern "C" {
//some code
};
what does this exactly mean?
Possible Duplicate:
Why do we need extern āCā{ #include <foo.h> } in C++?
many a times in our code i have seen some statements like following:
extern "C" {
//some code
};
what does this exactly mean?
It tells the C++ compiler that "some code" must be compiled in C style. This allows the linkage between C and C++ code.
More to the point, functions with C++ linkage will not be found by the linker when called from a C function unless you specify that the functions should have the same linkage type. So you'll get all sorts of link errors, which won't seem obvious as to why.