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/01 Report--
This article mainly explains "what are the command keywords contained in C language files". Interested friends may wish to have a look at them. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the command keywords contained in C language files?"
The keyword of the file that contains the command is "include". The file containing command "# include" is a common preprocessing command used by C language programs to introduce the corresponding header file (".h" file) in the format of "# include" Header.h "".
The operating environment of this tutorial: windows7 system, C99 version, Dell G3 computer.
# include is called the file include command, which is used to introduce the corresponding header file (.h file). # include is also a kind of C language preprocessing command.
The process of # include is simple: insert the contents of the header file into the location where the command is located, thus connecting the header file and the current source file into a source file, which is the same as copying and pasting.
# include can be used in two ways, as follows:
# include # include "myHeader.h"
Use angle brackets
< >The difference from the double quotation mark "" is that the search path for the header file is different:
Use angle brackets
< >The compiler will look for the header file under the system path
Using double quotation marks, the compiler first looks for the header file in the current directory, and if not, it looks under the system path.
In other words, using double quotes has one more lookup path than using angle brackets, and it is more powerful.
Previously, we have been using angle brackets to introduce standard header files, but now we can also use double quotes, as shown below:
# include "stdio.h" # include "stdlib.h"
Stdio.h and stdlib.h are standard header files, they are stored in the system path, so the use of angle brackets and double quotation marks can be successfully introduced; and our own header files, generally stored in the path of the current project, so can not use angle brackets, can only use double quotation marks.
Of course, you can also add the directory where the current project is located to the system path so that you can use angle brackets, but generally no one does so, which is purely unnecessary and thankless.
Notes on the usage of # include:
A # include command can contain only one header file, and multiple header files require multiple # include commands.
The same header file can be introduced multiple times, and the effect of multiple introduction is the same as that of one introduction, because the header file has a mechanism to prevent repeated introduction at the code level.
File inclusions allow nesting, that is, one included file can contain another file.
Example:
The code contained in my.c:
/ / calculate the sum from m to n and int sum (int m, int n) {int I, sum = 0; for (I = m; I
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.