Definition:
The # define Directive
You can use the # define directive to give a meaningful name to a constant in your program. The two forms of the syntax are:
Syntax
# Define identifier token-stringopt
# Define identifier [(identifieropt,...,
#defineThe command #define defines an identifier and a string. Each time the identifier is encountered in the source program, it is substituted with a defined string. The ANSI standard defines an identifier as a macro name and replaces the process
There are many places in the C language where macro definitions are used, such as in header files to prevent header files from being repeatedly included:
#ifndef ctest_header_h
#define CTEST_HEADER_H
/header file content
#endif
Many macro
Define command package
If the makefile contains some identical command sequences, we can define a variable for these identical command sequences. The syntax for defining this command sequence starts with "Define" and ends with "endef", for example:
Define is a pre-processing command in C language. It is used for macro definition, which can improve the readability of the source code and provide convenience for programming.Pre-processing commands start with "#", for example, include commands #
Define is a pre-processing command in C language. It is used for macro definition, which can improve the readability of the source code and provide convenience for programming.
Pre-processing commands start with "#", for example, include commands #
Note: These are common Modem commands. Some commands may not apply to all modem instances. If any problem occurs, see the modem documentation or contact the modem manufacturer's Technical Support Department.
All commands (with two exceptions) must
First, the constPHP5.3 Previously, const can only declare variables inside a class, 5.3+ allows variables to be declared externally, but cannot be evaluated with constants!Const one = 1; Const WORD = ' Hello World ';PHP5.6 Start, const supports
1, define--(no parameter macro definition)Usage: The general form is: #define Identifier string(1) "#" means that it is a pre-processing command, usually "#" is the pre-processing command;"Define" defines the command for the macro; "identifier" is
To write a good C language, a beautiful macro definition is very important. Macro definitions can help us prevent errors, improve the portability and readability of code, and so on.
During software development, there are often common or common
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.