In my assignment, it says
Do not add
long intorlong longprivate members to accomplish this as there is no guarantee that either can actually store larger numbers than anint.
I know that int has a maximum of 231-1 and long long has a maximum of 263-1. Can someone give me an example to me why the given sentence is true?
It means exactly what it says. There’s no guarantee that a
long longcan store more numbers than anint. It’s at least as big, but it can be the same.This can be true for some platform, with some compiler, but it’s not always the same. C++ doesn’t guarantee either.
3.9.1 Fundamental types [basic.fundamental]