在C++中用C编译函数-extern_c语言

使用extern "C" {} ,让C++兼容C语言。这个是C++特有的符号,为了让编译器遵循C语言规则

extern "C" {
int func(int a, int b) {
return a + b;
}
}