Macros Versus Functions
#define min(x,y) \
( ( (x)<(y) )?(x):(y) )
After this definition, the preprocessor replaces every occurrence of the form
min(a,b)
with the replacement text
( ( (a)<(b) )?(a):(b) )
where a and b can be ANY text.
Macros are not functions. There are no arguments passing, or return value to talk about.
Previous slide
Next slide
Back to first slide
View graphic version