The size of basic data types

This table gives the size and natural alignment of the basic data types in ARM C or C++.

Type Size in bits Natural alignment in bytes
char 8 1   (byte-aligned)
short 16 2   (halfword-aligned)
int 32 4   (word-aligned)
long 32 4   (word-aligned)
long long 64 8   (doubleword-aligned)
float 32 4   (word-aligned)
double 64 8   (doubleword-aligned)
long double 64 8   (doubleword-aligned)
All pointers 32 4   (word-aligned)
bool (C++ only) 8 1   (byte-aligned)
_Bool (C only[1]) 8 1   (byte-aligned)
wchar_t (C++ only) 16 2   (halfword-aligned)

[1]stdbool.h can be used to define the bool macro in C.

以上是The size of basic data types的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>