This indicates which link agreement to use. Most languages โโknow how to make a connection with a style C function.
You need this in two cases:
- C - or other languages โโfor this matter - a program that calls a function written in C ++
- C ++ program calling a function written in C
Example:
// declared in function.h void f1(void);
Your C code - in fact other languages โโcan refer to the C function - will not be able to reference it, because the name in the object table will use the C ++ convention.
If you write
extern "C" void f1(void);
The link now works because it uses the C convention.
Edouard A. Mar 04 '09 at 15:11 2009-03-04 15:11
source share