Why is the "long int" limit equal to the "int`"?

Asked

Viewed 195 times

1

The boundary of type int is 2147483647, but the type limit long int is also 2147483647. Why the limit has not increased?

  • 1

    The long int refers to a 32-bit flagged integer. The short int refers to a 16-bit flagged integer. The long long int refers to a 64-bit flagged integer (maybe it’s language extension/something non-standard that many use, I’m not sure). The type int can refer to a short int or to a long int, dependent on compiler implementation

  • See in Limits. h the minimum and maximum values for the various types of integer in your environment.

  • 1

    Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).

1 answer

2

The boundary of type int is 2147483647.

Not this information is false, it may have this limit, but nothing guarantees it. It may have less than this.

the type limit long int is also 2147483647

That’s not true either, that’s the minimum limit this guy should have, but he might have more.

Because the limit hasn’t risen?

This makes no sense. The only thing the specification says is that the long int may not be less than the int. There’s nothing to increase.

Jefferson’s comment is partly correct, so it remains to be said that this is the minimum size. The final sentence doesn’t make sense, these guys don’t mix, maybe he meant something a little different from this and got confused.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.