KyaPoocha.com

Huge Collection of Interview Questions


How do you link a C++ program to C functions? 

By using the extern “C” linkage specification around the C function declarations.
Programmers should know about mangled function names and type-safe linkages. Then they should explain how the extern “C” linkage specification statement turns that feature off during compilation so that the linker properly links function calls to C functions.

Another acceptable answer is “I don’t know. We never had to do that.” Merely describing what a linker does indicates that the programmer does not understand the issue that underlies the question.



If you liked this question/asnwer, make sure you
Subscribe to KyaPoocha.com RSS feed!


BOOKMARK THIS : BlinkList | del.icio.us | Digg it | Furl | reddit | StumbleUpon | Yahoo MyWeb |