From 9e5d2baac1fe53221df6407a72c2255cb014cd0a Mon Sep 17 00:00:00 2001 From: Pawan Bangar <34831511+pawanbangar@users.noreply.github.com> Date: Fri, 9 Nov 2018 00:52:35 +0530 Subject: [PATCH] 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 --- guide/english/c/macros/index.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/guide/english/c/macros/index.md b/guide/english/c/macros/index.md index 56424bf7bd..94123f9e2a 100644 --- a/guide/english/c/macros/index.md +++ b/guide/english/c/macros/index.md @@ -19,6 +19,13 @@ Is the same as write this: ```C 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 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 printf("Hello World!"); ``` - #### More Information: [GCC Online Documentation: Macros](https://gcc.gnu.org/onlinedocs/cpp/Macros.html)