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

Write a program to add three numbers in C++ utilizing classes.

624


What are the steps in the development cycle?

617


Difference between a copy constructor and an assignment operator.

580


How do I write a c++ program?

598


What is the use of string in c++?

553






Can a Structure contain a Pointer to itself?

612


What parameter does the constructor to an ofstream object take?

615


How can you tell what shell you are running on unix system?

644


Define a constructor - what it is and how it might be called (2 methods)?

606


Explain how functions are classified in C++ ?

810


Differentiate between an external iterator and an internal iterator?

572


How do we balance an AVL Tree in C++?

643


Name the debugging methods that are used to solve problems?

583


Is c++ low level?

582


What is a breakpoint?

563