In my assignment, it says "Do not add long int or long long private members to accomplish this as there is no guarantee that either can actually store larger numbers than an int." I know that int has a maximum of 2^31-1 and long long has a maximum of 2^63-1. So can someone give me an example to me why the given sentence is true?
Thanks in advance!
It means exactly what it says. There's no guarantee that a long long can store more numbers than an int. It's at least as big, but it can be the same.
I know that int has a maximum of 2^31-1 and long long has a maximum of 2^63-1
This can be true for some platform, with some compiler, but it's not always the same. C++ doesn't guarantee either.
2) There are five standard signed integer types : “
signed char”, “short int”, “int”, “long int”, and “long long int”. In this list, each type provides at least as much storage as those preceding it in the list. [...] (emphasis mine)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With