I'm working on VS2019, in windows 10 64bit. I was doing some try and I tried the following code
int main() {
unsigned long long ull = 70000;
unsigned int ui = ull;
std::cout << ui;
}
I would expect to get an output different from 70000, because 70000 is bigger then then the biggest number that an int variable can store. so why do I get 70000
as output? how is that possible?
A 32 bit unsigned int can store values from 0 to 4,294,967,295.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.