What is the difference between an int and a long in C++?

后端 未结 9 770
执笔经年
执笔经年 2020-11-22 07:15

Correct me if I am wrong,

int is 4 bytes, with a range of values from -2,147,483,648 to 2,147,483,647 (2^31)
long is 4 bytes, with a range of values from -2,147,

9条回答
  •  悲哀的现实
    2020-11-22 08:09

    It depends on your compiler. You are guaranteed that a long will be at least as large as an int, but you are not guaranteed that it will be any longer.

提交回复
热议问题