You are here: Home / Topics / Differentiate between the macros and the functions

Differentiate between the macros and the functions

Filed under: C Programming on 2022-07-16 16:40:48

The differences between macros and functions can be explained as follows:

MacrosFunctions
It is preprocessed rather than compiled.It is compiled not preprocessed.
It is preprocessed rather than compiled.Function checks for compilation errors.
Code length is increased.Code length remains the same.
Macros are faster in execution.Functions are a bit slower in execution.
Macros are useful when a small piece of code is used multiple times in a program.Functions are helpful when a large piece of code is repeated a number of times.
About Author:
M
Manisha Agrawal     View Profile
Hey, this website is very nice for mcqs.