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

Answer Posted / nikhil upadhyay

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.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is atoi safe?

809


What is the full form of india?

770


Why do we need templates?

740


What are the methods of exporting a function from a dll?

845


Explain the difference between static and dynamic binding of functions?

779


What is Destructor in C++?

930


Which software is used for c++ programming?

821


Is c++ the most powerful language?

750


What is c++ good for?

772


What is a dll entry point?

733


What is null c++?

816


Can user-defined object be declared as static data member of another class?

768


What do you know about near, far and huge pointer?

792


What is null pointer and void pointer?

817


If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?

796