adspace


How can you link a c program with a c function?

Answer Posted / Sujeet Kumar Singh

To link a C program with a C function, first write the C function in a separate '.c' file and put it in a shared library (.so/.dll on Linux/Windows respectively) using a compiler like gcc or clang. Then include the header file containing the function prototype in your C++ code and use the linker to link the shared library when compiling the final C++ program.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1165


What is the latest version on c++?

1209


What character terminates all character array strings a) b) . c) END

1397


Can union be self referenced?

1267


daily Routine of father

1485