c++代码中调用c函数

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/m0_37806112/article/details/82259762

在没有源码的情况下,别人会给你一个xx.o和xx.h文件,将下面这段代码写入xx.h文件中。

#ifndef _T_H_    //防止头文件被重复包括

#define _T_H_

#ifdef  __cplusplus

extern “C”

{

#endif

int add(int x,int y);

int max(int x,int y);

#ifdef __cplusplus

}

#endif

#endif

猜你喜欢

转载自blog.csdn.net/m0_37806112/article/details/82259762