How Do You Link A C++ Program To C Functions?
Answers
Answered by
0
Just declare the C++ function extern "C" (in your C++ code) and call it (from your C or C++ code). For example: // C++ code: extern "C" void f(int);
...
Now f() can be used like this:
1) /* C code: */
2) void f(int);
3)void cc(int i)
4) {
5) f(i);
6) /* ... */
7) }
Similar questions
Math,
6 months ago
Math,
6 months ago
English,
6 months ago
Computer Science,
11 months ago
Math,
11 months ago