Functions are global in nature, because a function is called by another function, or it can be specified that the function cannot be called by another file. The functions are distinguished from internal and external functions, depending on whether they can be called by other source files.
intrinsic function: (also called static function)
Can only be called by other functions in this file. Define the intrinsic function format as follows:
Static type identifier function name (formal parameter list)
such as: static int fun (int x,int y)
Using intrinsic functions, you can restrict the scope of a function to the file in which it resides, and have internal functions of the same name in different files. So different people can write different functions, without worrying about whether the function will have the same name as a function in other files, and usually put functions and external variables that can only be used by the same file in the same file, preceded by static to localize them, other files cannot be referenced.
External functions:
1. When defining a function, add the keyword extern at the leftmost end to indicate that the function is an external function (in C, omit extern, which is implied as an external function)
extern int fun (int x,int y)
2. In the file that needs to call this function, use extern to declare the function as an external function defined in another file.
A function prototype can extend the scope of a function beyond the file that defines the function (without using extern), as long as the function prototype of the function is included in each file that uses the function. Function prototype notifies the compilation system that the function is defined later in this file, or in another file.
--From the ancient rectification version C programming.
C/C + + internal functions and external functions