專(zhuān)注電子技術(shù)學(xué)習(xí)與研究
當(dāng)前位置:單片機(jī)教程網(wǎng) >> MCU設(shè)計(jì)實(shí)例 >> 瀏覽文章

The size of basic data types

作者:佚名   來(lái)源:本站原創(chuàng)   點(diǎn)擊數(shù):  更新時(shí)間:2014年01月23日   【字體:
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.

關(guān)閉窗口

相關(guān)文章