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.

This code have a mistake. We need to save result int r = SQUARE(++m); and print it after this.

2023 Feb 23, 1:08:31 PM

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести