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

What is this weird colon-member (" : ") syntax in the constructor?

626


What is the difference between global int and static int declaration?

503


Who invented turbo c++?

731


What is ios :: in in c++?

735


What do you mean by global variables?

671






What are the advantages of pointers?

682


What is the full form of india?

668


What are the advantages of using pointers in a program?

759


How do you initialize a string in c++?

651


Which bit wise operator is suitable for turning off a particular bit in a number?

737


Explain what is polymorphism in c++?

721


Who created c++?

677


What's the most powerful programming language?

680


Explain binary search.

686


What is the header file for setw?

688