C++Guns – RoboBlog

22.12.2016

sizeof(int)

Filed under: Allgemein — Tags: — Thomas @ 00:12

According to N3337

3.9.1 Fundamental types [basic.fundamental]
2
There are five standard signed integer types : “signed char”, “short int”, “int”, “long int”, and “long
long int”. In this list, each type provides at least as much storage as those preceding it in the list.
There may also be implementation-defined extended signed integer types. The standard and extended signed
integer types are collectively called signed integer types. Plain ints have the natural size suggested by the
architecture of the execution environment 44
; the other signed integer types are provided to meet special
needs.

44) ) that is, large enough to contain any value in the range of INT_MIN and INT_MAX, as defined in the header .

Thus
sizeof(short) <= sizeof(int) <= sizeof(long) Thx 2 m$ 4 <= instead of < ;)

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress