external c ++ “C”

• The function or variable qualified by extern is of extern type
• The variable and function modified by extern "C" are compiled and linked according to the C language. The function of
extern "C" is to make the C++ compiler declare extern "C" The code is treated as C language code, which can avoid the problem that C++ cannot link with symbols in the C language library due to symbol modification.
extern "C" uses

#ifdef __cplusplus
extern "C" {
    
    
#endif
void *memset(void *, int, size_t);

#ifdef __cplusplus
}
#endif

Guess you like

Origin blog.csdn.net/it_xiangqiang/article/details/112977941