Example: #define PI 3.14
We can undefine PI macro by #undef PI
A function is compiled once and can be called from anywhere that has visibility to the funciton.
Example: #define symbol replacement
When the preprocessor encounters #define directive, it replaces any occurrence of symbol in the rest of the code by replacement. This replacement can be an statement or expression or a block or simple text.
Example: #define CUBE(X)(X*X*X)
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.