extern "C" .cpp里调用.c文件里的函数,需要在.cpp 里另外声明
比如
test.c
void CTest()
{
return ;
}
test.h
void CTest();
test.cpp 里不能直接include test.h 而是 extern "C" void CTest();
//////////////////////////////////////////////////
_stdcall是Pascal程序的缺省调用方式,通常用于Win32 Api中,函数采用从右到左的压
本文介绍如何在C++代码中正确调用C语言编写的函数,包括必要的声明方式及调用约定如_stdcall等,并解释了extern C的作用。
11万+

被折叠的 条评论
为什么被折叠?



