using namespace std;
#include<iostream>
int main() {
int a = -2;
int b;
b = (a << 29) >> 29;
cout << hex << b;
}
输出还是-2
即a=b
using namespace std;
#include<iostream>
int main() {
int a = -2;
int b;
b = (a << 29) >> 29;
cout << hex << b;
}
输出还是-2
即a=b