You want to link a c++ program to c functions. How would you do it?



You want to link a c++ program to c functions. How would you do it?..

Answer / Monark Chawla

"To link a C++ program to C functions, you can use the extern "C" keyword in your C++ source files. This tells the compiler to treat the following code as if it were written in C. You should also compile your C files with the -c flag and include them in the C++ program's linking step using a linker script or by manually listing object files."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

To what does “event-driven” refer?

1 Answers  


What is implicit pointer in c++?

1 Answers  


What is oops in c++?

1 Answers  


Which software is best for programming?

1 Answers  


What are templates? where we should use it?

2 Answers   Alcatel,


Define what is constructor?

1 Answers  


What is the difference between struct and class?

2 Answers  


what are the events occur in intr activated on interrupt vector table

1 Answers   HGS,


What is a constructor initializer list and when we use constructor initializer list?

3 Answers   Soft Info, TCS,


What is extern c++?

1 Answers  


What are pointers used for c++?

1 Answers  


Why is swift so fast?

1 Answers  


Categories