In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article shows you how to understand the internal and external functions in the C language. The content is concise and easy to understand, which can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Functions are global in nature, because one function is called by another function, and it can also be specified that the function cannot be called by other files. Functions are divided into internal and external functions according to whether they can be called by other source files.
Internal function: (also called static function)
Can only be called by other functions in this file. Define the format of the internal function as follows:
Static type identifier function name (formal parameter table)
Such as: static int fun (int xpencil int y)
By using internal functions, the scope of functions can be limited to the files in which they are located, and there are internal functions with the same name in different files that do not interfere with each other. In this way, different people can write different functions separately, without having to worry about whether the functions used will have the same name as the functions in other files. Usually, the functions and external variables that can only be used in the same file are put in the same file, preceded by static to make them localized, and other files cannot be referenced.
External functions:
1. When defining a function, add the keyword extern to the far left to indicate that the function is an external function (in C, extern is omitted, implied as an external function)
Extern int fun (int x pencil int y)
two。 In the file that needs to call this function, declare the function with extern, indicating that the function is 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 is included in each file that uses the function. The function prototype informs the compilation system that the function is defined later in this file or in another file.
The above content is how to understand the internal and external functions in C language. have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.