4 ms·
The problem is macro expansion is not (potentially) what you think it is: MULTIPLY(2+3,4+5) that expands in 2+34+5 (and not into: (2+3)(4+5)). To have the la
by virtue3 6y ago
The problem is macro expansion is not (potentially) what you think it is:
MULTIPLY(2+3,4+5)
that expands in
2+34+5 (and not into: (2+3)(4+5)).
To have the latter, you should define:
#define MULTIPLY(a,b) ((a)*(b))
https://stackoverflow.com/questions/14041453/why-are-preprocessor-macros-evil-and-what-are-the-alternatives#:~:text=The%20trouble%20with%20macros%20is,comes%20down%20to%20personal%20preference https://stackoverflow.com/questions/14041453/why-are-preproc....