Macro vs inline

This page on Macro vs inline describes difference between Macro and inline. Both are used to avoid burden of calling the functions.


Macro is expanded by the compiler while inline functions are parsed by the compiler.

MACRO is implemented with the use of C++ preprocessor directive, while Inline functions by inline keyword.

#define square(x) (x*x)
int z=4;
int J=square(z);

Wherever in the C program square(x) comes it is replaced by x*x, hence it is prone to errors.

Inline functions evaluate argument once,and hence removes all the macro errors.

RELATED LINKS

C Programming Language tutorial

What is Difference between

difference between FDM and OFDM
Difference between SC-FDMA and OFDM
Difference between SISO and MIMO
Difference between TDD and FDD
Difference between 802.11 standards viz.11-a,11-b,11-g and 11-n
OFDM vs OFDMA
CDMA vs GSM
Bluetooth vs zigbee
Fixed wimax vs mobile

RF and Wireless Terminologies