#2
rjsp2023-03-29 21:21
|
为什么代码1的结果和代码2的结果不一样呢?原理是什么
代码1
long ua { 1000 };
long long* uptr { (long long*)&ua };
std::cout << *uptr;
long long* uptr { (long long*)&ua };
std::cout << *uptr;
代码2
long ua { 1000 };
long long uptr { (long long) ua };
std::cout << uptr;
long long uptr { (long long) ua };
std::cout << uptr;
```