c++对c的拓展_extern "C" 浅谈
extern "C" :c++编译器编译c函数时需要声明extern “C”
main.cpp test.h test.c
# include <iostream> #pragma once int test(int a,int b){
# include "test.h" #if __cpulspuls return a*b;
using namespace std; exturn "C"{
int main(){ #endif
int a=1; int test(int a,int b);
int b=2; #if __cplusplus
cout << test(a,b)<<endl; }
return 0; #endif
}

浙公网安备 33010602011771号