Home > Article > Backend Development > Are #include and #define C statements?
#include and #define are not C statements. In C language, only those ending with a semicolon (;) are regarded as C statements; "#" represents a preprocessing macro. #include and #define do not participate in compilation, but the source code is processed before the compiler compiles the source code. Processing adjustments.
include and #define are not C statements.
Only those ending with semicolon; are regarded as C statements.
#include and #define do not participate in compilation, but are processed by the preprocessor.
Among them, #include
#define A B simply replaces the occurrences of A with B in the file.
# represents preprocessing macros. These statements are not compiled into machine code for execution. Instead, the source code is processed and adjusted before the compiler compiles the source code.
For example, #define a 1 defines a constant, which is actually equivalent to the compiler replacing all corresponding constant symbols with constant values before compilation. Where a appears in all programs, the compiler replaces it with 1. There is no variable a involved in the actual running process.
Recommended tutorial: "C Language"
The above is the detailed content of Are #include and #define C statements?. For more information, please follow other related articles on the PHP Chinese website!