Why are C++ int and long types both 4 bytes?

前端 未结 8 1062
栀梦
栀梦 2020-12-01 10:49

Many sources, including Microsoft, reference both the int and long type as being 4 bytes and having a range of (signed) -2,147,483,648 to 2,147,483,647. What is the point of

8条回答
  •  执念已碎
    2020-12-01 11:31

    I think it's implementation dependent. They can vary, but it is up to the vendor to supply them. However, some vendors simply make it so that they are syntactically "supported" (ie: you can put them in your code and they will compile, but don't differ). Every so often, you'll encounter a language feature like this.

提交回复
热议问题