C++中調用C函數
// xx.h
extern int fun(); // 聲明fun
// xx.c
int fun() {} // 定義fun
// xx.cpp
extern "C"{
#include "xx.h"
}
fun(); // 使用fun
C中調用C++函數
// xx.h
extern "C"{
int fun();
}
// xx.cpp
int fun() {} // 定義fun
// xx.c
extern int fun(); // 聲明fun
fun(); // 使用fun