How does C++ call the written C interface?
This article mainly introduces how C++ calls the written C interface, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to know it.
1. C++ calls C file
A C language file test.c
# include void print (int a _ line int b) {printf ("what is called here is a C language function:% dline% d\ n", a _ line b);}
A header file test.h
# ifndef _ TEST_H # define _ TEST_H void print (int aline int b); # endif
C++ file calls C function
# include using namespace std; # include "test.h" int main () {cout