In C or C++ languages, pre-processing statements that begin with #
are called preprocessing statements.
#define
has several uses. As I asked, #defineAB
finds all the same spelling as A
in the code before compiling and replaces it with B
.
After the replacement is finished, proceed with the compilation.
For example,
#define TAX 0.5f
float t=TAX;
The above code will be compiled after being replaced as shown below.
float t=0.5f;
When defined as #defineAB
, A is usually referred to as a constant (or macro constant, also known as a symbol constant).
As I asked, the text A
is replaced with B
itself.
© 2024 OneMinuteCode. All rights reserved.