I have to convert some C/C++ code to Java. My C++ is extremely rusty.
In a .h
file, I have the following:
#ifdef __cplusplus
extern "C" {
#endif
/* tons of declarations */
#ifdef __cplusplus
} /* extern C */
#endif
What is the use of extern "C"
? What does it mean? Is it telling the compiler that corresponding code should be interpreted as pure C, rather than C++?
EDIT
Thanks for the answers so far. The history of the code I have to convert is that it seems like a part was written in C first, then the rest was written in C++. So my header file seems to correspond to 'old' C code.
I'll convert this code into a public final class
with static method and attributes. No overriding.