C++ to Java conversion question about extern "C" -


i have convert c/c++ code java. c++ extremely rusty.

in .h file, have following:

#ifdef __cplusplus extern "c" { #endif  /* tons of declarations */  #ifdef __cplusplus } /* extern c */ #endif 

what use of extern "c"? mean? telling compiler corresponding code should interpreted pure c, rather c++?

edit

thanks answers far. history of code have convert seems part written in c first, rest written in c++. header file seems correspond 'old' c code.

i'll convert code public final class static method , attributes. no overriding.

it's telling compiler function signatures should c compatible. name mangling different in c , c++ (i.e. c++ supports method overloading while c not) in order make function calls (i.e. dll dynamic calls) compatible c signature, use extern c in c++ code.

take @ stackoverflow question great explanation on topic.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -