If I do:
#define TIMEFIXCONST 11644473600
on a 32bit machine, will it overflow or will it be stored as a long long and still work properly? Should I just define a global unsigned long long and use that instead?
A macro is only a text substitution, you can't overflow a macro.
It depends on where do you assign later TIMEFIXCONST.
But as a rule of thumb, when using constants use const int or const long long if you require.
The number is not "stored" anywhere. It will just be inserted in the program source code where you use the macro, just as if you had written it directly. But if you want the literal itself to be of type long long, write:
#define TIMEFIXCONST 11644473600LL
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