???????c??c++
???????????? ???????[ 2012/8/7 14:52:44 ] ????????
#ifdef __cplusplus
extern "C" {
#endif
??????????????????з??c???????·???
#ifdef __cplusplus
}
#endif
???????????????c++?????в??????κ??????extern "C"?????include???c???????
// This is C++ code
// Get declaration for f(int i?? char c?? float x)
#include "my-C-code.h" // Note: nothing unusual in #include line
int main()
{
f(7?? 'x'?? 3.14); // Note: nothing unusual in the call
...
}
????5?????????????c++?????е????????????c????
????????????????????????c???????????????????????????????????c????????????????????extern "C"???????c++?????е???????c???????????????????????????????
extern "C" void f(int i?? char c?? float x);
???????c????????????????????????????
extern "C" {
void f(int i?? char c?? float x);
int g(char* s?? char const* s2);
double sqrtOfSumOfSquares(double a?? double b);
}
?????????????????????c++????????????????
int main()
{
f(7?? 'x'?? 3.14); // Note: nothing unusual in the call
...
????6??????????????????c????????c++????f(int?? char?? float)
????c++?????????????extern "C"?????f(int?? char?? float)????????c???????????
// This is C++ code
// Declare f(int??char??float) using extern "C":
extern "C" void f(int i?? char c?? float x);
...
// Define f(int??char??float) in some C++ module:
void f(int i?? char c?? float x)
{
...
}
????extern “C"?????????????????????????????????c???ù淶??????????????????????????????c???????????????????????????c?????????????
????7?????c++/c????????c/c++????????????????
????????????д??extern "C"????????????????????????????????c++????????????ú?c??????????????????????????????????????
????8???????????c++?????????????????c????
????????????????
????fred.h
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11