What Is The Function Of Macros?

What is the operate of macros? – a macro is a reputation given to a block of c statements as a pre-processor directive.

Being a pre-processor, the block of code is communicated to the compiler earlier than coming into into the precise coding (most important () operate).

A macro is outlined with the pre-processor directive. Macros are pre-processed which signifies that all of the macros could be processed earlier than your program compiles.

However, capabilities aren’t preprocessed however compiled. This exhibits that the macros are preprocessed whereas capabilities aren’t.

In macros, no sort checking(incompatible operand, and many others. ) is finished and thus use of macros can result in errors/side-effects in some circumstances.

However, this isn’t the case with capabilities. Also, macros don’t examine for compilation error (if any).

Consider the next two codes:.

Related Posts