Im a beginner. Could someone tell me what's the difference between long and int they both uses 4bytes of space and have the same range.
Asked
Active
Viewed 46 times
0
-
There does not need to be a difference. – drescherjm Sep 01 '18 at 02:24
-
***they both uses 4bytes of space*** That is with your compiler. It does not have to be the 4 bytes – drescherjm Sep 01 '18 at 02:25
-
"They both uses 4bytes of space...". No they don't! Not necessarily! For example, "int" is often 16 bits; "long" is often 64 bits. Per the standard, "long" is *AT LEAST* as wide as an "int". They needn't be the same, and often DIFFERENT. It depends entirely on a) platform, and b) compiler implementation. – paulsm4 Sep 01 '18 at 02:26