adspace
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