In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "what are the preprocessing commands in C++", so the editor summarizes the following contents, with detailed contents and clear steps, which can be used for reference. I hope you can get something after reading this article. Let's take a look at this "what are the preprocessing commands in C++" article.
C++ preprocessing command 1 # define
The command # define defines an identifier and a string. Each time the identifier is encountered in the source program, it is replaced with a defined string. The ANSI standard defines identifiers as macro names, and the replacement process is called macro replacement. The general form of a command is:
# define identifier string
Note:
The statement does not have a semicolon. There can be any space between the identifier and the string, and once the string starts, it ends with a new line.
Once a macro name is defined, it can become part of other macro name definitions.
Macro replacement is only a text string instead of a macro identifier, as long as the macro identifier must be identified independently, otherwise it will not be replaced. For example:
# define XYZ this is a test, use the macro printf ("XYZ"); / / this paragraph prints "XYZ" instead of "this is a test". Because the precompiler recognizes "XYZ".
If the string is longer than one line, you can continue the line with a backslash at the end of the line.
C++ preprocessing command 2 # error
The processor command # error forces the compiler to stop compiling, which is mainly used for program debugging.
C++ preprocessing command 3 # I nclude
The command # I nclude causes the compiler to embed another source file with # I nclude, which must be enclosed in double quotes or angle brackets. For example:
# include "stdio.h" or # include
Both lines of code use the C compiler to read and compile the subroutine used to process the disk file library.
It is possible to embed a file within a file in the # include command, which is called a nested embedded file, and the nesting level depends on the implementation.
If the explicit pathname is part of the file identifier, only those subdirectories are searched for embedded files. Otherwise, if the file name is enclosed in double quotes, the current working directory is retrieved first. If no files are found, search in all directories described on the command line. If the file is still not found, search for the standard directory defined at the time of the implementation.
If there is no explicit pathname and the file name is enclosed in angle brackets, it is first retrieved in the directory on the compilation command line.
If the file is not found, the standard directory is retrieved, not the current working directory.
The above is about the content of this article on "what are the preprocessing orders in C++". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about it, please 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.