Skip to content

Commit a31e7af

Browse files
authored
Update C_syntax.md
preprocessor directives
1 parent 86ee74a commit a31e7af

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

LearningC/C_Language_Shorts/C_syntax.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,19 @@ When you want to create a function you put the prototype at the beginning of the
113113
## Loop
114114
115115
## Preprocessor Directives
116+
They start with a hash **#** and should be declared at the top of the file.
117+
> [!NOTE]
118+
> Commonly we use:
119+
> ```
120+
> #include <header-file>
121+
> #define UPPERCASE_NAME <substitution> //Macro definition
122+
> ```
123+
>
124+
125+
> [!TIP]
126+
> A classical example of Macro definition
127+
> `#define MAX(A,B) ((A)>(B)?(A):(B))` \
128+
> in brackets for the case where A or B is am expresion which has to be evaluated first
129+
>
130+
> For `#include` [headers](C_Files.md#header)
131+
>

0 commit comments

Comments
 (0)