ADD "Undefining Macro" (#21287)

* ADD "Undefining Macro"

we can undefine macro whenever we want in code by adding #undefine

* fix: markdown title format

* fix: minor grammar corrections

Capitalise first word and remove extra full stops
This commit is contained in:
Pawan Bangar
2018-11-09 00:52:35 +05:30
committed by nik
parent 09ccd61302
commit 9e5d2baac1

View File

@ -19,6 +19,13 @@ Is the same as write this:
```C ```C
printf("Value of PI: %d", 3.14); printf("Value of PI: %d", 3.14);
``` ```
#### Undefining Macros
After defining macros you can also undefine them at any point.
just Type
```C
#undefine PI
```
This is used to use macros only for specific lines of code and again undefine it.
#### Types of macros #### Types of macros
There are two type of macros. The `Object-like` macros, showed above, and the `Function-like` macros. There are two type of macros. The `Object-like` macros, showed above, and the `Function-like` macros.
@ -48,7 +55,6 @@ You get the equivallent of:
```C ```C
printf("Hello World!"); printf("Hello World!");
``` ```
#### More Information: #### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article --> <!-- Please add any articles you think might be helpful to read before writing the article -->
[GCC Online Documentation: Macros](https://gcc.gnu.org/onlinedocs/cpp/Macros.html) [GCC Online Documentation: Macros](https://gcc.gnu.org/onlinedocs/cpp/Macros.html)