extern c function
Oct 29, 2019 pm 04:17 PM#extern The main function of "C" is to correctly implement C code to call other C language codes.
After adding extern "C", the compiler will be instructed to compile this part of the code in C language (not C). Since C supports function overloading, when the compiler compiles a function, it will also add the parameter type of the function to the compiled code, not just the function name; and the C language does not support function overloading, so compiling C The function of the language code does not include the parameter type of the function, generally only the function name is included.
This function is very useful, because before C appeared, many codes were written in C language, and very low-level libraries were also written in C language. In order to better support the original C code and the already written A good C language library needs to support C in C as much as possible, and extern "C" is one of the strategies.
This function is mainly used in the following situations:
1. C code calls C language code;
2. In the C header file Use;
3. When multiple people collaborate on development, some people may be better at C language, while others are good at C. It will also be useful in this case.
Recommended tutorial: C language tutorial
The above is the detailed content of extern c function. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Method of copying code by C language compiler

What are the web versions of C language compilers?

What are the alternatives to NULL in C language

C language online programming website C language compiler official website summary

Is NULL still important in modern programming in C language?

C language compiler installation tutorial (computer version)
