For example, I saw source code like the following. Can we use #define in a function? How does it work? (more information: this code is what I copied from
How does it work? All C/C++ files are first processed by... the preprocessor.
It doesn't know anything about C nor C++ syntax. It simply replaces THIS_THING with ANOTHER THING. That's why you can place a #define in functions as well.