Nonetheless, macros are valuable. One practical example comes from
<stdio.h>
, in whichgetchar
andputchar
are often defined as macros to avoid the run-time overhead of a function call per character processed. The functions in<ctype.h>
are also usually implemented as macros.
This is from the book. I did not understand why MACROS help reducing overhead. All they are doing is to just increase one more step in compilation process.