Watch at the following simple code,
Compiling it with the command g++ -std=c++14 -g -O2 CODE.cpp
produces the strange Output :
Why this ?? -2147483648
# include<bits/stdc++.h>
using namespace std;
# define pc(x) putchar(x)
template <class T>
inline void pd(T num, char ch = ' '){
num = -num;
cout << "Why this ?? " << num << endl;
}
int main(void){
pd(INT_MIN);
return 0;
}
Please explain this behavior !!