For given SQUARE macro definition, what value will be shown on a screen after executing next code:
#define SQUARE(x) ((x)*(x))
int m = 4;
SQUARE(++m);
std::cout << r;
Explanation
During the #define directive execution, text substitution of each symbol "X", that was found in the body of the function, to the current value of the variable "m" is performed. Thus, after such type of replacement current, the ​value of "m" is increased by 1.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes