Q:

What is the effect of extern “C” in C++?

0

What is the effect of extern “C” in C++?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer : 

extern “C” makes a function-name in C++ have ‘C’ linkage (the compiler does not mangle the name) so that client C code can link to (i.e use) your function using a ‘C’ compatible header file that contains just the declaration of your function. Your function definition is contained in a binary format (that was compiled by your C++ compiler) that the client ‘C’ linker will then link to using the ‘C’ name.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Interview Questions For Experienced

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Why do C++ compilers need name mangling?... >>
<< How can I include a non-system C header file in my...