Why this macro gives output 144, instead of 121?
#include #define SQR(x) x*x int main() { int p=10; std::cout<
Because you are using undefined behaviour. When the macro is expanded, your code turns into this:
std::cout<<++p*++p;
using increment/decrement operators on the same variable multiple times in the same statement is undefined behaviour.